Check out example codes for "how to install react router dom with typescript". It will help you in understanding the concepts better.

Code Example 1

npm install react-router-dom @types/react-router-dom

# Yarn
yarn add react-router-dom @types/react-router-dom

Learn ReactJs, React Native from akashmittal.com