Questions
Let’s test our knowledge of React Router with the following questions:
- We have declared the following routes in an app:
const router = createBrowserRouter([
{
path: "/",
element: <App />,
errorElement: <ErrorPage />,
children: [
{ path: "customers", element: <CustomersPage /> }
]
}
]);
What component will render when the path is /customers
?
What component will render when the path is /products
?
- What would the path be in a route that could handle a
/customers/37
path?37
is a customer ID and could vary. - The routes for a
settings
page are defined as follows:{
path: "/settings",
element: <SettingsPage />,
children: [
{ path: "general", element: <GeneralSettingsTab...