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

受控组件与非受控组件 #8

Open
ZWkang opened this issue May 7, 2018 · 0 comments
Open

受控组件与非受控组件 #8

ZWkang opened this issue May 7, 2018 · 0 comments

Comments

@ZWkang
Copy link
Owner

ZWkang commented May 7, 2018

受控组件(Controlled Component)
非受控组件(Uncontrolled Component)

受控组件(Controlled Component)

什么叫受控组件呢?
web开发有一点常用的就是表单,
在表单提交拿值时,
我们将表单元素值存储在state内,并且经过处理函数操作setState改变表单值。
这样的形式就是受控组件了。
(当然,当你使用props的时候,值存在props中,改变元素值改变props这也是一种受控)

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

1 participant