react-responsive-carousel
react-responsive-carousel copied to clipboard
Carousel' cannot be used as a JSX component Error if using yarn2 pnp mode with typescript
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": "*"