issue: defaultValues not working with FormProvider and useFormContext #11478
Unanswered
efraimrodrigues
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @efraimrodrigues, |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
7.0.0-alpha.0 & 7.50.0
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/react-hook-form-normalize-field-forked-khppy8?file=%2Fsrc%2Findex.js%3A69%2C41
Steps to reproduce
Material UI Price
doesn't load with defaultValueExpected behaviour
Material UI Price
input should load with defaultValueI have updated Normalize/Format/Mask Field example a little bit to mimic the configuration I have in my project and use
FormProvider
anduseFormContext
to create a controlled input. I expected theMaterial UI Price
input to load with default value but it doesn't.Although I can see the
ref
object getting intoTextField
, I have the impression this has to do withref
not being managed or used correctly. I have tried different ways of giving it to thecustomInput
(see example in the CodeSandbox link) but none of them worked.What browsers are you seeing the problem on?
Chrome
Relevant log output
No log output. No errors in the console.
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions