React Router Flashcards
Router library
react-router-dom
In order to use Router you have to
wrap the entire app in BrowserRouter
difference between exact and strict
Use case 1
If you use exact and strict together, then the location.pathname will only match exactly as provided in path props.
Example:
Will only match /one but not /one/ and /one/two.
Example:
Will only match /one/ but not /one and /one/two.
Use case 2
If you use only strict, then the location.pathname will match which have trailing slash.
Example:
Will match /one/ and /one/two but not /one.
Use case 3
If you use only exact, then the location.pathname will match exact location path.
Example:
Will match /one or /one/. The exact props doesn’t care for trailing slash. But it will not match /one/two.