Skip to content
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

StrictMode 下 preserve=fasle,使用动态节点时添加的值无法保存 #705

Open
wanpan11 opened this issue Jul 3, 2024 · 2 comments

Comments

@wanpan11
Copy link
Contributor

wanpan11 commented Jul 3, 2024

StrictMode 会导致 Field 组件卸载一次,这时 preserve=false 就会把 store 里的对应字段重置为 undefined,导致无法赋值。

image

image

@wanpan11
Copy link
Contributor Author

wanpan11 commented Jul 3, 2024

把首次创建的 value 缓存起来当 InitialValue 应该可以 @zombieJ 佬看看 有撒好的办法不

@wanpan11
Copy link
Contributor Author

wanpan11 commented Jul 4, 2024

加到 InitialValue 里,reset 会有问题🤧🤧

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant