-
Notifications
You must be signed in to change notification settings - Fork 995
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
Form: use context to handle coercions #834
Conversation
@cannikin it would be great to get this into the next release given you approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me in theory! Has someone actually built a form with fields nested in components and made sure it works?
The included test has this, where a
Did you have something else in mind? |
Ahhh, I don't know if it makes any difference but I thought this was so that if you have entire components nested inside the form, and those nested components have form fields, everything still works. But as far as React is concerned maybe just wrapping one in a |
@cannikin |
@cannikin Anything else you need from me to be able to merge this? |
Yikes, who added that? I haven't cared about IE11 for a decade! I don't think that we ever compiled an official browser support declaration. But shouldn't Babel be able to handle that for us anyway? I remember seeing something in a Babel config for >2% usage? Does IE11 still get used by 2% of people? Otherwise looks good to me! |
@cannikin I added that TODO to not forget about it when I wrote the code since I didn't know what browsers you all wanted to support. I've since rewritten the code to support IE11 as well, and obviously removed the TODO. I looked in to polyfills, but they were pretty big, so didn't want to add that. Was easy enough to just rewrite :)
Lucky you! We still have to care about it on a daily basis at work |
@thedavidprice Already approved! |
This is an alternative solution to #826 to handle nested form fields.
I feel this is a more idiomatic React solution, using Context instead of recursive looping over child elements.
Fixes #825