- The react-router package is the official package used for routing in React apps and therefore, the only option.
- No, react-router is the de facto routing solution for React and you should use it unless you have a strong reason not to.
- What's the difference between Route and Router components?
- A Route is used to render components based on URL matches and a Router is used to declare route-component mappings.
- How do you change only certain parts of the UI as the route changes?
- You use Route components to render content that is specific to any given section, based on the provided path property. You can have more than one Route with the same path value.
- When should you use the NavLink component?
- When you want to use the activeStyle or activeClassName properties to style active links
- How do you get values from URL paths?
- You use the : syntax to specify that this is a variable and react-router will pass this value into your component as a property