-
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
Adds all input type Field form helpers #511
Conversation
Wait... did you break the CI?? |
Yeah what happened to the logs? It doesn’t show anything happening. :( I got an email like 30 minutes after my first commit that ESLint didn’t like something, but since then I can’t see anything in the Checks tab... |
@peterp did you get a chance to look at adding that Babel plugin you mentioned? Thanks dude! |
711c520
to
2341368
Compare
After mush gnashing of teeth we found we can't do the easy export statement the way we hoped. We have to list the name of every function manually. Ugh. |
* Adds all input typesCloses redwoodjs#510 * Adds comments and docs * More docs * Simplify function creation * Disable eslint on useFormContext call * Fixes exports Co-authored-by: Rob Cameron <rob.cameron@fastmail.com> Co-authored-by: Peter Pistorius <peter.pistorius@gmail.com>
This covers the ones we already had (Hidden, Text, Checkbox, Radio) and adds all the others found here: https://www.w3schools.com/html/html_form_input_types.asp
It uses a bit of metaprogramming—it uses the input types in a loop to create the component definitions on the fly and then assigns them to an object. The only downside is that you can't dynamically export all the objects, you need to name each and every one manually. :(