formily
formily copied to clipboard
[Bug Report] useFormEffect 中使用 onFieldChange 在 React18 开发环境的严格默认下,会执行两次
- [x] I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
Steps to reproduce
点开链接,打开控制台,更改值,发现执行两次
What is expected?
只执行一次
What is actually happening?
执行了两次
Package
@formily/[email protected]
原因就是 onFieldChange 被执行了两次,虽然在 useFormEffect 销毁时移除了 effect,但是没有将 onFieldChange reaction 的依赖的清除掉
这个我来处理。
暂时可以使用 onFieldValueChagne 绕过这个问题