Error "Cannot use JSX unless the '--jsx' flag is provided" in TypeScript and React
Hi everyone! I'm new to TypeScript and React, trying to set up a project, but I've run into an error that I can't overcome for the second day.
I have a simple React component that I'm writing in a .tsx file:
```tsx
import React from 'react';
interface Props {
name: string;
}
const Greeting: React.FC = ({ name }) => {
return
Hello, {name}!
; }; export default Greeting; ``` When I run compilation via `tsc`, I get the error: ``` Cannot use JSX unless the '--jsx' flag is provided. ``` I'm using TypeScript version 5.0.3, React 18, and my tsconfig.json looks like this: ```json { "compilerOptions": { "target": "ES2020", "module": "ESNext", "strict": true, "esModuleInterop": true, "outDir": "./dist",No answers yet.
Log in to leave an answer