You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
由于我们的表单依赖项很复杂,我们在实现联动的时候全部使用 onFieldReact 的被动模式来让每个字段的联动逻辑更加清楚。
考虑联动逻辑为
A 的值变动时,清空 B 的值
的时候codesandbox: https://codesandbox.io/s/beautiful-rgb-63d9cd?file=/App.tsx
想询问一下针对这种清空值的场景我们是不是不能使用 onFieldReact 来处理,而是使用 onFieldInputValueChange 来确保只有当用户录入的时候才触发联动逻辑?
如果不使用 onFieldReact 来控制值的清空,则会存在 onFieldReact 和 onFieldInputValueChange 一起作用于单个字段,因为 onFieldReact 依然用来控制字段的属性例如 disable, dataSource 等,而属性的联动需要在初始值设置的时候触发。有没有更好的处理方案呢?
Beta Was this translation helpful? Give feedback.
All reactions