mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Remove route event in componentWillUnmount (#6196)
`Router.events.off` should be called instead of `Router.events.on` in `componentWillInmount`.
This commit is contained in:
parent
5a4176cffe
commit
0e13d8c952
|
@ -26,7 +26,7 @@ class HeaderNav extends React.Component {
|
|||
|
||||
componentWillUnmount () {
|
||||
Router.onRouteChangeComplete = null
|
||||
Router.events.on('routeChangeComplete', this.handleRouteChangeTopLevelRouter)
|
||||
Router.events.off('routeChangeComplete', this.handleRouteChangeTopLevelRouter)
|
||||
this.props.router.events.off('routeChangeComplete', this.handleRouteChange)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue