1
0
Fork 0
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:
Christian Sánchez Mendoza 2019-02-03 08:13:30 -05:00 committed by Tim Neutkens
parent 5a4176cffe
commit 0e13d8c952

View file

@ -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)
}