question: Issue using Controller component with FormProvider
#11345
Replies: 3 comments
-
|
I've not looked into your sandbox yet, but the first thing you should try is to provide the default values to |
Beta Was this translation helpful? Give feedback.
-
@Moshyfawn, Already there in the code: |
Beta Was this translation helpful? Give feedback.
-
|
Oh man, you put your entire project as the reproduction sandbox and I can't even find the code you referenced in your issue. Please consider creating a minimal reproduction sandbox instead. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version Number
v7
Codesandbox/Expo snack
https://codesandbox.io/p/github/RiyaadHossain/Jobster/main
Steps to reproduce
I'm using the React Hook Form in my React application.
I used the custom
FormandFormInputIconcomponents in my project.Formcomponent:FormInputIconcomponent:SignInModalWhere I used these above components:Now the problem is when I click on the
Continuebutton on theSignInModalit doesn't reset the input field value. Even though I used theresetfunction in theFormcomponent.Here:
Note that, I also console.log the input data. In the console, it gets cleared but on the display, it still shows the text that I typed.

Also, I'm getting a warning in the console.
What's the issue? React
Expected behaviour
The
resetfunction should work properly as well the warning message should be removed.Also, there needs the functionality to work when using
defaultValues.What browsers are you seeing the problem on?
Chrome
Relevant log output
{email: 'riyad@gmail.com', password: 'asdfasdf'} {email: undefined, password: undefined}Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions