简体   繁体   中英

Clear the store everytime I change the hash, React

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文简体   中文繁体   中英对照 版本,有任何建议请联系yoyou2525@163.com。

I'm sharing info located on mi RTK store, between two diferentes routes / components.

Each view share the element products , that's why when I go from one route to another, if I search something on route 1 , and then I go to route 2 this one still display the search I made on the first one.

I need to clear the store everytime the hash changes, I was thinking on using onHashChange, but I don't know how to apply that to this case inside React.

我商店的图片参考

No answers.You can refer to the related questions on the right.
暂无
暂无

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM