A set of <Route> components can also be generated by looking up an array containing a collection of route configuration options. Each route option should contain the necessary details, such as 'path' and 'component'.
A collection of routes could look like the following:
const STOCK_ROUTES = [
{
path: 'stats',
component: StatsComponent,
},
{
path: 'news',
component: NewsComponent
},
{
path: 'trending',
component: TrendingComponent
}
];
Each object in the preceding array contains a 'path' key specifying the route path, and a 'component' key containing a reference to the component that you want to render when the user visits the route. The preceding collection can then be used inside the component's render method to...