Ref of element is undefined when using nested object #10952
Unanswered
16TheHung10
asked this question in
General
Replies: 1 comment
-
Please provide a codesandbox url to reproduce the issue. |
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.
-
This is my Component with name "sourceItem[1].itemCode": and element Input is imported from antd;
<Controller
control={control}
name={name}
render={({ field }) => {
return (
<Input
className={
${get(formState.errors, name) ? 'field-error' : ''}
}{...field}
{...props}
type={type}
onBlur={(e) => {
props.onBlur && props.onBlur(e);
field.onBlur(e);
}}
/>
);
}}
/>
When I console.log errors from formState, the ref to element is undefined , but when Im using normal name like "itemCode" everything is ok.
Beta Was this translation helpful? Give feedback.
All reactions