Skip to content

Commit

Permalink
ReactNode Controller render prop return type
Browse files Browse the repository at this point in the history
ReactElement excludes `null` as a valid return type from the `render` prop. However `null` is used in the docs samples to conditionally render fields from `useFieldArray`.

https://codesandbox.io/s/usefieldarray-virtual-input-v9wyw?file=/src/App.js:402-510
  • Loading branch information
ianschmitz committed Dec 1, 2021
1 parent 159f4a9 commit 466c5ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ export type ControllerProps<
field: ControllerRenderProps<TFieldValues, TName>;
fieldState: ControllerFieldState;
formState: UseFormStateReturn<TFieldValues>;
}) => React.ReactElement;
}) => React.ReactNode;
} & UseControllerProps<TFieldValues, TName>;

0 comments on commit 466c5ef

Please sign in to comment.