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

issue: In the specified sandbox environment, when the onChange event handler is invoked with undefined as its argument, the Component does not receive the updated value. However, despite this, the form data is successfully updated. #1042

Closed
1 task done
manishjatiwal opened this issue Jan 17, 2024 · 4 comments

Comments

@manishjatiwal
Copy link

manishjatiwal commented Jan 17, 2024

Version Number

7.49.3

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/rhf-bug-mfygck?file=%2Fsrc%2FApp.js

Steps to reproduce

Just open the sandbox, and click on the buttons.
The first component uses undefined as the argument to onChange, and hence is not working as expected.
The second component used empty string as as the argument to onChange, and works beautifully.

Expected behaviour

After setting the value as undefined by calling the onChange(undefined), ComponentOne should get the update value i.e, undefined, instead of default value.

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 transferred this issue from react-hook-form/react-hook-form Jan 17, 2024
@bluebill1049
Copy link
Member

can you share the link for the page? and which codesandbox

@manishjatiwal
Copy link
Author

@bluebill1049
Copy link
Member

yes that's the one you forked, i want to know the original

@manishjatiwal
Copy link
Author

@bluebill1049 Why close this? I am uncertain about your request. The issue in question can be readily replicated using the provided code sandbox.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants