From the home page, which lists all users, it would be nice to be able to navigate to another page showing details about a specific user. To make this possible, let's start by modifying the UserList component and add a link for the user login:
<td><Link to={`/user/${u.login}`}>{u.login}</Link></td>
Now, clicking on such a link will redirect us to http://localhost:3000/user/me. This just shows a blank page since our application has not been configured yet.
Let's go ahead and configure the application. The content of the App component has to be replaced with the following code. We will use a Router object to do so:
export default function App() {
return (
<Router>
<div>
<h1>My app</h1>
</div>
<Switch>
<Route exact path="/" component={UserList} />
<Route path="/user/:login" component={User} />
...