Complete the code to import the main React Router component for routing.
import { [1] } from 'react-router-dom';
The BrowserRouter component is the main router component that enables routing in React apps.
Complete the code to define a route that renders the Home component at the root path.
<Route path='[1]' element={<Home />} />
The root path '/' matches the home page URL.
Fix the error in the code to correctly render the routes inside the router.
return ( <BrowserRouter> <[1]> <Route path='/' element={<Home />} /> <Route path='/about' element={<About />} /> </[1]> </BrowserRouter> );
The Routes component wraps all Route elements in React Router v6+.
Fill both blanks to create a link that navigates to the About page.
<[1] to='[2]'>About</[1]>
The Link component creates navigation links, and the to prop sets the target path.
Fill all three blanks to extract the 'id' parameter from the URL using React Router hooks.
import { [1] } from 'react-router-dom'; function Item() { const params = [2](); return <p>Item ID: {params.[3]</p>; }
The useParams hook returns URL parameters as an object. Access the 'id' parameter to show it.