Skip to content

几点疑惑 #111

@ldwstyle

Description

@ldwstyle

1.react-keeper有没有类似react-router withRouter的组件,让我能够在页面中获取路由信息。
2.react-keeper的Route匹配规则有没有类似react-router

<Switch location={location}></Switch>

的匹配规则,主要解决页面跳转动画问题。举例:用react-transition-group做动画,从首页进入列表页面,首页移除,列表页渲染,但是react-transition-group会把首页保留一段时间(做动画使用),但是Route会强行把首页替换成列表页(由于浏览器地址变了),结果是页面上出现2个列表页,这样我根本无法做动画。
3.leaveFilter。举例说明:

<Route  component={Index} leaveFilter={this.leaveFilter}  path="/" />     
<Route  component={List} leaveFilter={this.leaveFilter} path="/project/:projectId>" />    
<Route  component={Task} leaveFilter={this.leaveFilter} path="/project/:projectId/task/:taskId>" />   

从Index页面进入List页面,会触发每个Route的leaveFilter,我认为应该只触发Index-Route的leaveFilter,因为当前就是Index离开了。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions