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

Code Example 1

react typescript

Code Example 2

npm install --save typescript @types/node @types/react @types/react-dom @types/jest
# or
yarn add typescript @types/node @types/react @types/react-dom @types/jest

Code Example 3

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

Learn ReactJs, React Native from akashmittal.com