onFieldValueChange无法监听到field.remove|.push等方法 #1294
Answered
by
janryWang
marinaJane08
asked this question in
Q&A [2.x]
-
https://codesandbox.io/s/agitated-hermann-2r4ye?file=/App.tsx |
Beta Was this translation helpful? Give feedback.
Answered by
janryWang
Apr 25, 2021
Replies: 2 comments
-
这个转到issue里吧,下次遇到可复现的问题,作为bug提到issue里 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
marinaJane08
-
这个问题我想了很久,ArrayField/ObjectField场景有点特殊,这些操作方法都是对value的引用做操作的,主要是为了性能,不需要每次操作都copy数据做immutable操作,但是引用操作就没法监听到变化了,如果要支持这种模式,那就相当于得深度监听变化,但这样对性能影响非常大,所以就先hold住这个问题吧,不过从你说的问题来看,你应该是希望监听这些操作方法,目前有两个方案 直接在操作按钮上传onClick事件,在事件回调里做逻辑处理 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这个转到issue里吧,下次遇到可复现的问题,作为bug提到issue里