-
Notifications
You must be signed in to change notification settings - Fork 632
Description
Steps to reproduce:
- Set up a TypeScript React project with the MentionsInput and Mention components.
- Attempt to use the MentionsInput and Mention components within a .tsx file.
- Compile the project using tsc or run the app.
- Observe the error in the terminal/logs.
Expected behaviour:
MentionsInput and Mention should render without any TypeScript errors.
Observed behaviour:
TypeScript throws the following errors:
Error TS2786: 'MentionsInput' cannot be used as a JSX component.
Explanation: Its type 'MentionsInputClass' is not a valid JSX element type.
Details: Type 'ComponentClass<MentionsInputProps, any>' is not assignable to type 'new (props: any, deprecatedLegacyContext?: any) => Component<any, any, any>'. Property 'refs' is missing in type 'Component<MentionsInputProps, any, any>' but required in type 'Component<any, any, any>'.
Error TS2786: 'Mention' cannot be used as a JSX component.
Explanation: Its type `'FC' is not a valid JSX element type.
Details: Type 'FunctionComponent' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
Workaround:
No workaround identified as of now.