score:3

Accepted answer
const Main = ({ match }) => { //assume main component.
    return (<div>
        This is the Root component.
        <Route path={`${match.url}`} exact component={ShowsPage} ></Route>
        <Route path={`${match.url}tickets`} exact component={ticketsPage}></Route>
        <Route path={`${match.url}shows`} exact component={ShowsPage}></Route>
    </div>)
};

score:2

<Switch>
 <Route path="/" exact component={ShowsPage}/>
 <Route path="/tickets" exact component={ticketsPage}/>
 <Route path="/shows" exact component={ShowsPage}/>
</Switch>

Related Query

More Query from same tag