mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Set this.mounted
to false when dynamic component is unmounted (#4333)
Otherwise you may get a React warning about calling setState() on an unmounted component.
This commit is contained in:
parent
d3c710b325
commit
7f621324fc
|
@ -137,6 +137,10 @@ export default function dynamicComponent (p, o) {
|
|||
this.loadBundle(nextProps)
|
||||
}
|
||||
|
||||
componentWillUnmount () {
|
||||
this.mounted = false
|
||||
}
|
||||
|
||||
render () {
|
||||
const { AsyncComponent, asyncElement } = this.state
|
||||
const { LoadingComponent } = this
|
||||
|
|
Loading…
Reference in a new issue