"missing ref" error from version 6.10
See original GitHub issueDescribe the bug I am using:
- React + Typescript
- Material-ui (
@material-ui/core
) for the UI - Material-ui-pickers (
@material-ui/pickers
) for the KeyboardDatePicker date-fns
and DateFnsUtils (@date-io/date-fns
) for the pickerreact-hook-form
(of course)yup
and@hookform/resolvers/yup
resolver.
Trying to connect a KeyboardDatePicker with the Controller
component I was getting errors, so I googled and found a solution (see sandbox below), but with my version of react-hook-form
(which is 6.11.3) it is not working.
The error in console says:
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
This happens only with any version that is >= 6.10.0
To Reproduce Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/react-hook-form-ref-bug-rji1w
- The Date input is working
- Update react-hook-form to any version that is >= 6.10.0
- See error in console
Codesandbox link (Required)
Expected behavior A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
- OS: [e.g. iOS] any
- Browser [e.g. chrome, safari] Chrome
- Version [e.g. 22]
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
How to correct a #REF! error - Microsoft Support
The #REF! error shows when a formula refers to a cell that's not valid. This happens most often when cells that were referenced...
Read more >How to solve the #REF! error on spreadsheets - Sheetgo Blog
The simplest way to rectify this error is to undo your actions to revert back to your original spreadsheet and find another way...
Read more >Error NU1605 Detected package downgrade - Stack Overflow
I had a similar issue with a .netcoreapp2.2 console application. The project was building successfully. However, publishing was failing with ...
Read more >Ajv: Another JSON Schema Validator - npm
missingRefs: handling of missing referenced schemas. Option values: true (default) - if the reference cannot be resolved during compilation the ...
Read more >Using Amelia
In the presence of missing data, most statistical packages use ... Additionally, write.amelia() can create a “stacked” version of the ...
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
Was able to move forward just passing all props
render={props => ( autoOk ... {...props} size="small" ... )}
Thanks, got it working with the following code
by also setting
defaultValues
tonull
to avoid “converting uncontrolled input to controlled” error 😃