O'Reilly logo

Learning Web Development with React and Bootstrap by Mehul Bhatt, Harmeet Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

React routing

We have to use routing in client-side applications. For ReactJS we also need another routing library, so I recommend you use react-router, which is provided by the React community.

The advantages of React routing are:

  • Viewing declarations in a standardized structure helps us to instantly identify our app views
  • Lazy code loading
  • Using react-router, we can easily handle the nested views and their progressive resolution of views
  • Using the browsing history feature, a user can navigate backwards/forwards and restore the state of the view
  • Dynamic route matching
  • CSS transitions on views when navigating
  • Standardized app structure and behavior, useful when working in a team

Note

The React router doesn't provide any way to handle data fetching. We need ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required