-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
Drop ReactLink hooks in controlled components #2302
Comments
👍 |
This should be rather trivial, should I draft a PR? |
Yo @petehunt this was your jam. Any opinions? |
@sebmarkbage Could you give examples of wrappers needed ? (I'm new to the contribution in React, sorry if I ask trivial questions ^^') |
Any clues ? |
@sebmarkbage Could you give an example of how to best deal with multiple form inputs without linkState? |
The two following are equivalent, it's just sugar really. https://github.com/facebook/react/blob/master/src/addons/link/LinkedStateMixin.js |
ReactLink may be "just sugar really," but when you have dozens of inputs in a form and hundreds in the entire application, it makes a noticeable difference. JSX itself is "just sugar really," but it's an important tool for productivity and readability. Compare:
That being said, I'm all for taking ReactLink out of core, _if_ the syntax doesn't explode like in the example above. |
@tobia Like I mention in #3591, you can wrap an |
This was fixed in #8165. |
ReactLink supports a sort of adhoc two-way data binding. We've found it to be a distraction rather than helpful so we don't plan on adding it to the core outside of addons anyway.
We should take the support out of controlled components and make wrappers that can be used instead of the controlled components, and put the wrappers in addons. This provides backwards compatibility without having the legacy remain in core.
The text was updated successfully, but these errors were encountered: