๐—•๐—ฟ๐—ผ๐˜„๐˜€๐—ฒ๐—ฟ ๐—ฅ๐—ผ๐˜‚๐˜๐—ฒ๐—ฟ ๐—ถ๐—ป ๐—ฅ๐—ฒ๐—ฎ๐—ฐ๐˜

You build a React app. You want users to move between pages. You do not want the page to refresh.

Use Browser Router.

It connects URL paths to components. It helps you build Single Page Applications.

Without Browser Router:

With Browser Router:

Setup: npm install react-router-dom

  1. Import BrowserRouter.
  2. Wrap your App component.

Main components:

Do not use anchor tags. Use the Link component. It stops the page refresh.

Source: https://dev.to/jayashree_a84b6eff7bc414e/browser-router-in-react-lon