Check out example codes for "create-react-app typescript". It will help you in understanding the concepts better.

Code Example 1

npx create-react-app my-app --template typescript
# or #
yarn create react-app my-app --template typescriptCopy

Code Example 2

npx create-react-app my-app --template typescript

Code Example 3

npx create-react-app my-app --template typescript

# or
yarn create react-app my-app --template typescript

Code Example 4

npx create-react-app my-app --template typescript# oryarn create react-app my-app --template typescriptCopy

Code Example 5

create-react-app app-name --scripts-version=react-scripts-ts

Code Example 6

npm install --save typescript @types/node @types/react @types/react-dom @types/jest

Learn ReactJs, React Native from akashmittal.com