import React from "react";import {BrowserRouter as Router, Switch, Route, Link, useParams, useRouteMatch}
from "react-router-dom";export default function NestingExample() {
return (
Home
Topics
);}function Home() { return (
Home
);}function Topics() { // The `path` lets us build paths that are relative to the parent route, while the // `url` lets us build relative links.
let { path, url } = useRouteMatch();
return (
Topics
Rendering with React
Components
Props v. State
Please select a topic.
);}function Topic() { // The that rendered this component has a path of `/topics/:topicId`. The // `:topicId` portion of the URL indicates a placeholder that we can/ get from // `useParams()`.
let { topicId } = useParams();
return (