omitResetState not working
See original GitHub issueDescribe the bug
Setting dirtyFields
on omitResetState argument when using reset
does not seem to prevent dirty fields being reset. Am I missing something? My goal is to reset values when I receive a refresh from API, but I don’t want dirty fields to be reset.
To Reproduce Steps to reproduce the behavior:
- Open this codesandbox
- Edit “Note” or “Email”
- Click on ''Reset data"
- Even if note and/or email are dirty due to step 2, they are being reset
Codesandbox link
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How to reset setValues in react-hook-form version 7?
I have form some prefilled values from api and i set them with setValues('input-field-name','value-got-from-api') and when a i use reset method ...
Read more >Migrate From V6 to V7 - Simple React forms validation
Performant, flexible and extensible forms with easy-to-use validation.
Read more >Learn the most of react-hook-form in less than 5 minutes
React Hook Form is a tiny library without any dependencies. ... By supplying omitResetState , you have the freedom to only reset specific ......
Read more >react-hook-form: Versions - Openbase
running reset() error when not found will be silenced and throw a console warning. 3.8.4. 4 years ago.
Read more >[React] React Hook Form (v7)알아보기 - WONILLISM's Blog
not working, because ref is not assigned <TextInput {...register('test')} /> const firstName ... Record<string, any>, omitResetState?:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s all good 👍 @dhmacs thanks for giving a test.
I’ll try to implement this so I can formulate a better feature request