diff --git a/components/dash-core-components/src/components/Location.react.js b/components/dash-core-components/src/components/Location.react.js index a9aa6916ad..bf534e486b 100644 --- a/components/dash-core-components/src/components/Location.react.js +++ b/components/dash-core-components/src/components/Location.react.js @@ -121,6 +121,14 @@ export default class Location extends Component { this.updateLocation(this.props); } + componentWillUnmount() { + window.onpopstate = () => {}; + window.removeEventListener( + '_dashprivate_pushstate', + this.onLocationChange + ); + } + UNSAFE_componentWillReceiveProps(nextProps) { this.updateLocation(nextProps); }