modernize

- update react
- get rid of componentWillReceiveProps
- add service worker and fix pwa issues
This commit is contained in:
xmcp
2019-08-20 00:44:28 +08:00
parent 3aa1881c55
commit 18b44fbe21
7 changed files with 9169 additions and 7248 deletions

View File

@@ -7,10 +7,12 @@ export class Sidebar extends PureComponent {
this.sidebar_ref=React.createRef();
}
componentWillReceiveProps(nextProps) {
//console.log('sidebar top');
if(this.sidebar_ref.current)
this.sidebar_ref.current.scrollTop=0;
componentDidUpdate(nextProps) {
if(this.props.content!==nextProps.content) {
//console.log('sidebar top');
if(this.sidebar_ref.current)
this.sidebar_ref.current.scrollTop=0;
}
}
render() {