Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Its instance type 'Steps' is not a valid JSX element. #101

Closed
joaoguilhermee opened this issue Jan 20, 2023 · 1 comment
Closed

Its instance type 'Steps' is not a valid JSX element. #101

joaoguilhermee opened this issue Jan 20, 2023 · 1 comment

Comments

@joaoguilhermee
Copy link

Describe the bug

I am having problems using the intro.js with typescript

`'Steps' cannot be used as a JSX component.
Its instance type 'Steps' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'React.ReactNode' is not assignable to type 'import("/Users/_j/Github/project/node_modules/@types/react-transition-group/node_modules/@types/react/index").ReactNode'.
Type '{}' is not assignable to type 'ReactNode'.

`

To Reproduce

  1. Just add the or on the project

Expected behavior

This should work as expected with TS

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

@HiDeoo
Copy link
Owner

HiDeoo commented Jan 20, 2023

This is a fairly common issue when having multiple versions of @types/react used as dependency by third-party libraries that are incompatible.

The incompatibility in your case is due to React 17 types for ReactNode including {} which was removed in the React 18 types.

As specified in the linked comment, you can fix this issue by pinning the version of @types/react in your project, depending on your package manager:

@HiDeoo HiDeoo closed this as completed Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants