DeepMap error when spreading on `defaultValues`
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
To Reproduce
Go to sandbox.
View the defaultValues
section – comment out the spreaded and uncomment the non spreaded… notice the typescript error difference
Codesandbox link (Required)
https://codesandbox.io/s/dry-violet-z0tpe
Expected behavior
Types inferred without DeepMap error on the overridden defaultValues
Screenshots
Additional context
RHF 6.9.5
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (4 by maintainers)
Top Results From Across the Web
ngrx- default values being overwritten through spread operator?
I was under the impression that the spread operator within a newly defined object would create a copy, but that appears to be...
Read more >TS Support | React Hook Form - Simple React forms validation
Performant, flexible and extensible forms with easy-to-use validation.
Read more >Lodash Documentation
Creates a new array concatenating array with any additional arrays and/or values. Since. 4.0.0. Arguments. array (Array): The array to concatenate ...
Read more >Changelog - scssphp - GitHub Pages
Improve error messages for incorrect units in color functions (@stof) ... Add support for deep map manipulation in map-get , map-has-key and ...
Read more >ESO Phase 3 Data Release Description - ESO.org
ated by considering the information on the instrument line spread function, ... The pipeline parameters for this recipe are set to their default...
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 Free
Top 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
FYI @kotarella1110 I made the following change on DeepPartial.
I think this issue is related as well: https://github.com/react-hook-form/react-hook-form/issues/3289
here is a CSB that was working correctly with the generic: https://codesandbox.io/s/pedantic-perlman-f93x8?file=/src/App.tsx:0-296 however I can spot the type is actually
any
, correct me if I am wrong, we will need to have the generic atuseForm
to fix those issues.Yes, @kotarella1110 is investigating a solution. worse case we will have to use with passing the generic.