mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 02:53:50 +01:00
Bump react version
This commit is contained in:
parent
a6eeb3f3f6
commit
1a5f0fd9d0
21892
package-lock.json
generated
21892
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -40,7 +40,7 @@
|
||||
"proptypes": "^1.1.0",
|
||||
"raf": "^3.4.0",
|
||||
"ramda": "^0.21.0",
|
||||
"react": "^16.0.0",
|
||||
"react": "^16.0.1",
|
||||
"react-addons-update": "^15.6.2",
|
||||
"react-jss": "^7.0.2",
|
||||
"react-notification-system-redux": "^1.2.0",
|
||||
|
@ -79,27 +79,35 @@ class App extends React.Component {
|
||||
preventScroll: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.container = React.createRef();
|
||||
}
|
||||
|
||||
state = {
|
||||
loaded: isLoaded()
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const { container } = this.refs;
|
||||
|
||||
if (!this.state.loaded) load.then(() => this.setState({ loaded: true }));
|
||||
|
||||
container.addEventListener('dragover', this.dragOver);
|
||||
container.addEventListener('drop', this.onDrop);
|
||||
container.addEventListener('wheel', this.onWheel);
|
||||
window.addEventListener('keydown', this.onKeyDown);
|
||||
if (this.container.current) {
|
||||
this.container.current.addEventListener('dragover', this.dragOver);
|
||||
this.container.current.addEventListener('drop', this.onDrop);
|
||||
this.container.current.addEventListener('wheel', this.onWheel);
|
||||
window.addEventListener('keydown', this.onKeyDown);
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
const { container } = this.refs;
|
||||
container.addEventListener('dragover', this.dragOver);
|
||||
container.removeEventListener('drop', this.onDrop);
|
||||
container.addEventListener('wheel', this.onWheel);
|
||||
window.removeEventListener('keydown', this.onKeyDown);
|
||||
if (this.container.current) {
|
||||
|
||||
this.container.current.addEventListener('dragover', this.dragOver);
|
||||
this.container.current.removeEventListener('drop', this.onDrop);
|
||||
this.container.current.addEventListener('wheel', this.onWheel);
|
||||
window.removeEventListener('keydown', this.onKeyDown);
|
||||
}
|
||||
}
|
||||
|
||||
dragOver = event => {
|
||||
@ -232,7 +240,7 @@ class App extends React.Component {
|
||||
const { loaded } = this.state;
|
||||
|
||||
return (
|
||||
<div ref="container" className={classes.container}>
|
||||
<div ref={this.container} className={classes.container}>
|
||||
<InlineIconsLoader />
|
||||
{loaded && <div className={classes.appContainer}>
|
||||
<D2Panel />
|
||||
|
Loading…
Reference in New Issue
Block a user