In the Rendering to strings section, you implemented a single request handler in the server that responded to requests for the root URL (/). Your application is going to need to handle more than a single route. You learned how to use the react-router package for routing in Chapter 9, Handling Navigation with Routes. Now, you're going to see how to use the same package in Node.js.
First, let's take a look at the main App component:
import React from "react";
import { Route, Link } from "react-router-dom";
import FirstHeader from "./first/FirstHeader";
import FirstContent from "./first/FirstContent";
import SecondHeader from "./second/SecondHeader";
import SecondContent from "./second/SecondContent";
export default function App() {
return (
<section>
<header>
<Route exact path="/" render={() => <h1>App</h1>} />
<Route exact path="/first...