Error "Cannot use JSX unless the '--jsx' flag is provided" in TypeScript and React
Hello everyone! I'm new to React and TypeScript, trying to set up my first project. I installed create-react-app with the TypeScript template, but when compiling I get this error:
```
Cannot use JSX unless the '--jsx' flag is provided.
```
My code in the App.tsx file looks like this:
```tsx
import React from 'react';
const App: React.FC = () => {
return (
);
};
export default App;
```
I created the project via `npx create-react-app my-app --template typescript`. There's a tsconfig.json in the folder, but I haven't looked at it. When I run `npm start`, everything works, but if I try to compile the project manually via `tsc`, I get this error.
I also noticed that if I change the file extension from .tsx to .ts, the error disappears, but th
Hello, World!
No answers yet.
Log in to leave an answer