forked from newthuhole/hole_thu_frontend
modernize
- update react - get rid of componentWillReceiveProps - add service worker and fix pwa issues
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user