Commit 0e13d8c9 authored by Christian Sánchez Mendoza's avatar Christian Sánchez Mendoza Committed by Tim Neutkens

Remove route event in componentWillUnmount (#6196)

`Router.events.off` should be called instead of `Router.events.on` in `componentWillInmount`.
parent 5a4176cf
...@@ -26,7 +26,7 @@ class HeaderNav extends React.Component { ...@@ -26,7 +26,7 @@ class HeaderNav extends React.Component {
componentWillUnmount () { componentWillUnmount () {
Router.onRouteChangeComplete = null Router.onRouteChangeComplete = null
Router.events.on('routeChangeComplete', this.handleRouteChangeTopLevelRouter) Router.events.off('routeChangeComplete', this.handleRouteChangeTopLevelRouter)
this.props.router.events.off('routeChangeComplete', this.handleRouteChange) this.props.router.events.off('routeChangeComplete', this.handleRouteChange)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment