React Router Flashcards

1
Q

Router library

A

react-router-dom

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In order to use Router you have to

A

wrap the entire app in BrowserRouter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

difference between exact and strict

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly