-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
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
在react-router-dom中使用,没有用KeepAlive包裹,但是scroll位置依然被保存了,请问怎么解决 #269
Comments
|
嗯~,我重新研究了一下,发现问题好像不是这么简单,KeepAlive里面保存的状态,useState里面的数据,我改变完以后,跳出去,再进来,发现又变成了初始状态,并没有保留我改变后的值 |
如果使用了 react 严格模式,需要关掉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1.<Route path={'/main/all-bill'} component={()=>} />
2.<Route path={'/main/all-bill'} component={()=><KeepAlive when={false} saveScrollPosition={"false"} name='AllBill' id='AllBill'>} />
这两种写法都无效,也就是说saveScrollPosition={false}属性无效,scroll位置还是被保存了,但是我不想缓存这个组件以及它的scroll
The text was updated successfully, but these errors were encountered: