Skip to content
New issue

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

onFieldsChange 的 fields 参数各字段中 ‘instance’ 属性存在循环结构,导致 Redux DevTools 报错 #19

Closed
clarkhan opened this issue May 14, 2016 · 3 comments

Comments

@clarkhan
Copy link

目前将 fields 直接存储到 redux store 中,但是会遇到如下的错误:

VM3378:21 Uncaught TypeError: Converting circular structure to JSON

经排查后发现这是 Redux DevTools 报的错,由 fields 各字段中的 'instance' 引起,在 dispatch 前删掉就可以正常。

现在想问下,这个属性的作用是什么,可以删掉吗?如果删掉没问题最好还是在 onFieldsChange 的参数中就干掉。

@benjycui
Copy link
Member

https://github.com/react-component/form#notes

@yiminghe 或者可以整理为:

  • this.fieldsMeta 开发者指定的信息,如:validateTrigger rules
  • this.fileds 动态生成且可以序列化的信息,如:value errors
  • this.xxx 动态生成且不可以序列化的信息,如:instance

@yiminghe
Copy link
Member

@benjycui instance 放到 this.fieldInstances 上吧

@benjycui
Copy link
Member

主要是顾虑都以后会不会还有类似 instance 的字段再现。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants