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
Edit
复现地址
https://stackblitz.com/edit/formily-react-demo-hsycaf?file=package.json,src%2Fdemo%2FSchemaDemo.tsx
const form = createForm({ effects: () => { onFieldValueChange('input', (field) => { console.log(field.value) // 这里修改这个值,会导致爆栈 field.setValue(field.value + '_'); }); }, });
effects 在设计上,是否应该像 xReactions 一样,在修改的时候不会导致其自身调用?
使用 onFieldHooks 注册的 reactions,不会调用自身
调用自身了,且最终导致栈溢出
@formily/[email protected]
The text was updated successfully, but these errors were encountered:
@janryWang @quirkyshop 这个现象是符合预期的吗?这个例子其实是简化后的,很多时候会出现调用到其他逻辑再调用回来产生的联动死循环
Sorry, something went wrong.
你这个写法有问题,死循环了。onFieldValueChange 就是通过监听当前字段值变化触发的。你在onFieldValueChange修改了当前字段值,肯定死循环了
No branches or pull requests
Reproduction link
Edit
Steps to reproduce
复现地址
https://stackblitz.com/edit/formily-react-demo-hsycaf?file=package.json,src%2Fdemo%2FSchemaDemo.tsx
effects 在设计上,是否应该像 xReactions 一样,在修改的时候不会导致其自身调用?
What is expected?
使用 onFieldHooks 注册的 reactions,不会调用自身
What is actually happening?
调用自身了,且最终导致栈溢出
Package
@formily/[email protected]
The text was updated successfully, but these errors were encountered: