After updating react-hook-form to 6.12.2 getting Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? #3660
Unanswered
yaroslav-prokipchyn
asked this question in
General
Replies: 1 comment
-
which version of react-select are you using? https://codesandbox.io/s/react-hook-form-focus-74ecu?file=/src/index.js |
Beta Was this translation helpful? Give feedback.
0 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.
-
Hello after updating react-hook-form from ^6.4.1 to 6.12.2 I start getting a warning
** Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?**
in chrome console when instantiating this code
<Controller as={Select} control={control} name={'status'} rules={{ required: true }} .... />
note this as={Select} select is functional component, wrapper over reasct-supper-select.
I don't use ref explicitly and believe this can be incorrect code in the lib.
Tell me please what can be the reason for this warning.
Beta Was this translation helpful? Give feedback.
All reactions