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

Code Example 1

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

Code Example 2

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

Learn ReactJs, React Native from akashmittal.com