Bump react version

This commit is contained in:
Casper Lamboo 2021-05-19 19:14:32 +02:00
parent a6eeb3f3f6
commit 1a5f0fd9d0
3 changed files with 14816 additions and 7110 deletions

21804
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -79,28 +79,36 @@ 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);
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);
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 => {
event.preventDefault();
@ -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 />