Skip to main content

What is React Router?

React Router is a routing library built on top of React, which is used to create routes in a React application. This is one of the most frequently asked react interview questions.

  • It maintains consistent structure and behavior and is used to develop single-page web applications. 
  • Enables multiple views in a single application by defining multiple routes in the React application.

How is React routing different from conventional routing?

React RoutingConventional routing
Single HTML pageEach view is a new HTML file
The user navigates multiple views in the same fileThe user navigates multiple files for each view
The page does not refresh since it is a single fileThe page refreshes every time user navigates
Improved performanceSlower performance