Skip to content
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

fix #11328 resetField with object as defaultValue #11329

Merged

Conversation

geeee
Copy link
Contributor

@geeee geeee commented Dec 21, 2023

issue: resetField sets same instance of an object provided as defaultValue to both control._defaultValues and control._formValues
fix: adding cloneObject() inside resetField before setting object to defaultValues and formValues

Copy link

codesandbox bot commented Dec 21, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@bluebill1049 bluebill1049 merged commit 94114e4 into react-hook-form:master Dec 21, 2023
7 checks passed
@bluebill1049
Copy link
Member

thanks for the PR.

rafaelcalhau pushed a commit to rafaelcalhau/react-hook-form that referenced this pull request May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants