First Step - Create parent route

Let’s start by creating the parent route, or the ‘/’ route which will call main component on which we will render child components.

in index.js create:

import React from 'react';

import ReactDOM from 'react-dom';

import App from "./components/App";

import {BrowserRouter} from "react-router-dom";





ReactDOM.render(

<BrowserRouter>

<App />

</BrowserRouter>,

document.getElementById('root')

);

Great, we are using BrowserRouter as our router, and App as our parent component (or the ‘/’ route).