Complete the code to import the main routing component from React Router.
import { [1] } from 'react-router-dom';
The BrowserRouter component is the main router that uses the browser's history API for client-side routing.
Complete the code to define a route for the home page path '/' with the Home component.
<Route path='[1]' element={<Home />} />
The root path '/' represents the home page in routing.
Fix the error in the code to navigate programmatically using the hook.
const navigate = [1]();The useNavigate hook returns a function to change routes programmatically in React Router v6+.
Fill both blanks to create a link to the about page with accessible text.
<Link to=[1] aria-label=[2]>About Us</Link>
The to prop should point to the about page path "/about". The aria-label provides descriptive text for screen readers, here "Go to About page".
Fill both blanks to create a routes setup with home and profile paths.
<Routes> <Route path=[1] element={<Home />} /> <Route path=[2] element={<Profile />} /> <Route path='*' element={<NotFound />} /> </Routes>
The home page path is "/", the profile page is "/profile". The wildcard '*' catches all other paths. The option "user" is a distractor here and not used in correct answers.