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

Carousel' cannot be used as a JSX component Error if using yarn2 pnp mode with typescript #762

Open
winty56 opened this issue Jul 19, 2024 · 0 comments

Comments

@winty56
Copy link

winty56 commented Jul 19, 2024

I share solutions for people who are experiencing issues like #634

This problem caused by ghost dependencies in yarn pnp mode.
It because @types/react package is not defined as the package's peerDependencies, so the type of react cannot be found.

I leave a fix for those who have experienced the same problems as me.

add below code in .yarnrc.yml file in your project root
(Of course @types/react must be defined in your project's package.json :) )

packageExtensions:
  "react-responsive-carousel@*":
    peerDependencies:
      "@types/react": "*"
@winty56 winty56 changed the title JSX element class does not support Error if using yarn2 pnp mode with typescript Carousel' cannot be used as a JSX component Error if using yarn2 pnp mode with typescript Jul 19, 2024
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

1 participant