Typescript - "Cannot find name" errors in React components
I have also come across the same problem. This may be due to the extension you use as .ts
file doesn't allow JSX code in it. Instead you should use .tsx
extension.
Typescript isn't expecting to see JSX in your Typescript file. The easiest way to resolve this is to rename your file from .ts
to .tsx
.
JSX in Typescript Documentation