Commit 1fdc4082 by Wee

fix: clear scroll position when unmount

parent 961c21a6
......@@ -95,7 +95,6 @@ class Route extends React.Component {
}
componentWillReceiveProps(nextProps, nextContext) {
console.log('into cwrp')
warning(
!(nextProps.location && !this.props.location),
'<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'
......@@ -139,7 +138,6 @@ class Route extends React.Component {
componentWillUnmount() {
if (this.doesRouteEnableLive()) {
window.sessionStorage.removeItem(this.routeId)
this.routeDom = null
}
}
......@@ -193,6 +191,7 @@ class Route extends React.Component {
console.log('---- NORMAL UNMATCH FLAG----')
this.liveState = NORMAL_RENDER_UNMATCH
this.routeDom = null
window.sessionStorage.removeItem(this.routeId)
}
}
......
{
"name": "react-live-route",
"version": "1.1.10",
"version": "1.1.11",
"description": "A living route for react-router-v4",
"repository": "fi3ework/react-live-route",
"license": "MIT",
......
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