Using ReactJS + TypeScript
npx create-react-app my-app --template typescript
yarn create react-app my-app --template typescript
If you want to change a existing project over to TypeScript, first install the below:
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
yarn add typescript @types/node @types/react @types/react-dom @types/jest
Now you have to rename any file that ends in .js with .tsx (e.g. src/index.js to src/index.tsx) and restart your development server! Type errors will show up in the same console, you will have to fix the type errors before you continue development or build your project.
Check out my ReactJS + TypeScript GitHub Todo List example React TypeScript