FieldArray in typescript #3568
Answered
by
sebastiansas1
othmanekahtal
asked this question in
Show and tell
-
Hi 👋 'FieldArray' cannot be used as a JSX component.
Its element type 'ReactElement<any, any> | Component<FieldArrayConfig, any, any> | null' is not a valid JSX element.
Type 'Component<FieldArrayConfig, any, any>' is not assignable to type 'Element | ElementClass | null'.
Type 'Component<FieldArrayConfig, any, any>' is not assignable to type 'ElementClass'.
The types returned by 'render()' are incompatible between these types.
Type 'React.ReactNode' is not assignable to type '../node_modules/@types/hoist-non-react-statics/node_modules/@types/react/index").ReactNode'.
Type '{}' is not assignable to type 'ReactNode'.``` |
Beta Was this translation helpful? Give feedback.
Answered by
sebastiansas1
Feb 27, 2024
Replies: 3 comments 1 reply
-
React 18 types maybe? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I'm having the latest typing and react version, but still get this error:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
For anyone still trying to fix this error, try this:
Then use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
othmanekahtal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone still trying to fix this error, try this:
Then use
FormikFieldArray
as the compoment.