You are looking for the ROUTING and rendering components based on the url params 🙂
You click some tabs -> Your URL params are getting changed and differents components are getting rendered
<Route path={`${path}`} exact component={Profile} />
<Route path={`${path}/comments`} component={Comments} />
<Route path={`${path}/contact`} component={Contact} />
Example I found -> https://codesandbox.io/s/react-tabs-using-router-y6b92