Commit 703aebff by Wee

fix(computeMatchWithLive): save lastest normal render match correctly

parent 4e1947ea
...@@ -157,11 +157,16 @@ class Route extends React.Component { ...@@ -157,11 +157,16 @@ class Route extends React.Component {
this.liveState = NORMAL_RENDER this.liveState = NORMAL_RENDER
this._prevRouter = this.context.router this._prevRouter = this.context.router
return match return match
} else if ((livePathMatch && prevMatch) || props.alwaysLive) { } else if (livePathMatch || props.alwaysLive) {
// 备份一下需要渲染的参数 // 备份一下需要渲染的参数
console.log('------- HIDE FLAG-------') console.log('------- HIDE FLAG-------')
this.liveState = HIDE_RENDER this.liveState = HIDE_RENDER
return prevMatch if (prevMatch) {
this._prevMatch = prevMatch
return prevMatch
} else {
return this._prevMatch
}
} else { } else {
this.liveState = NORMAL_RENDER this.liveState = NORMAL_RENDER
console.log('------- NO MATCH FLAG -------') console.log('------- NO MATCH FLAG -------')
......
{ {
"name": "react-live-route", "name": "react-live-route",
"version": "1.1.3", "version": "1.1.4",
"description": "A living route for react-router-v4", "description": "A living route for react-router-v4",
"repository": "fi3ework/react-live-route", "repository": "fi3ework/react-live-route",
"license": "MIT", "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