We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
与 @CHEN-J-H 微信沟通发现此问题
由于 react-activation 形成了组件断层,处于 KeepAlive 中的组件将无法获取到 Route 所处上下文环境中的 match 等信息,造成 withRouter/hooks 等依赖上下文环境的功能异常
如下示例中,Item 组件将无法通过 withRouter 或 useParams 获取到 match 当中的 params.id 信息
目前无法在 activation 内部无感知解决,需要手动做如下兼容处理
<Route exact path="/item/:id" render={(props) => ( <KeepAlive> + <Route computedMatch={props.match}> <Item /> + </Route> </KeepAlive> )} />
经过测试的 router 版本:
在线示例地址:https://codesandbox.io/s/santi-demo-forked-2i9gz
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题
与 @CHEN-J-H 微信沟通发现此问题
由于 react-activation 形成了组件断层,处于 KeepAlive 中的组件将无法获取到 Route 所处上下文环境中的 match 等信息,造成 withRouter/hooks 等依赖上下文环境的功能异常
如下示例中,Item 组件将无法通过 withRouter 或 useParams 获取到 match 当中的 params.id 信息
解决方案
目前无法在 activation 内部无感知解决,需要手动做如下兼容处理
经过测试的 router 版本:
在线示例地址:https://codesandbox.io/s/santi-demo-forked-2i9gz
The text was updated successfully, but these errors were encountered: