fix(@uform/core/react): fix #613 #615 #618
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #613
这个问题,想了很多方案,最终都没有找到可以让用户不改代码就能解决的方案,之前给的临时方案是给children设置一个空数组,但是这样很容易遗漏,并不是可行方案,所以,只能考虑给Field维度新增一个dataType的概念,默认是any,指定array的话,它会在数组项被销毁之后,节点自动销毁
Fix #615
这个问题,是踩了React的坑,useRef在组件unmount之后引用会被自动销毁,diff信息对比就会失效,所以需要将diff信息存在field维度中,其实这也合理