Paste with react-hook-form #1173
GiantRobots
started this conversation in
Show and tell
Replies: 1 comment 4 replies
-
Hey @GiantRobots - thanks for sharing this! Seems awesome. If you're willing, we'd love to see this in a codesandbox so it's easier to share and folks who aren't as comfortable running a local env can still play with it. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After the DSYS team updated input boxes to not require the value field so we can use uncontrolled inputs I decided to write an example app of 4 different ways of doing form state. Standard Usestate calls, react-hook-form raw, react-hook-form with a helper, and react-hook-form using the controlled component methodology. I've attached the project below it should work with a quick
npm install
andnpm run dev
I did notice that the react-fast technology while running development mode didn't work quite right with the refs and so maybe there is an issue either in paste or the implementation of react-hook-form. (haven't done the due diligence to figure it out) so that's something to eyeball/consider if you're going to use this form handling methodology.
This video shows the various ways that it handles user input as well as the re-rendering properties of the library without many optimizations.
Screen.Recording.2021-02-05.at.4.29.00.PM.mov
formtest.zip
The majority of the code that I wrote if you don't wan't to grab the zipfile.
Beta Was this translation helpful? Give feedback.
All reactions