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

21892
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -79,27 +79,35 @@ 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);
window.addEventListener('keydown', this.onKeyDown); this.container.current.addEventListener('wheel', this.onWheel);
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);
window.removeEventListener('keydown', this.onKeyDown); this.container.current.addEventListener('wheel', this.onWheel);
window.removeEventListener('keydown', this.onKeyDown);
}
} }
dragOver = event => { dragOver = event => {
@ -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 />