Skip to content

Type error cannot be used as a JSX component #1013

Closed Answered by corysimmons
corysimmons asked this question in Q&A
Discussion options

You must be logged in to vote

I was running into this in a monorepo too. It seems its not able to find the React types. This fixed it: https://stackoverflow.com/a/75093164/175825

My tsconfig for that dir:

{
  "compilerOptions": {
    "jsx": "preserve",
    "paths": {
      "react": [ "./node_modules/@types/react" ]
    }
  }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by corysimmons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant