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