File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react';
22import ReactDOM from 'react-dom/client' ;
33import { createBrowserRouter , RouterProvider } from 'react-router-dom' ;
44// import Root from './routes/root';
5+ import Index from './routes'
56import ErrorPage from './error-page' ;
67import Contact from './routes/contact' ;
78import Root , {
@@ -23,6 +24,7 @@ const router = createBrowserRouter([
2324 loader : rootLoader ,
2425 action : rootAction ,
2526 children : [
27+ { index : true , element : < Index /> } ,
2628 {
2729 path : 'contacts/:contactId' ,
2830 element : < Contact /> ,
Original file line number Diff line number Diff line change 1+ export default function Index ( ) {
2+ return (
3+ < p id = "zero-state" >
4+ This is a demo for React Router.
5+ < br />
6+ Check out{ " " }
7+ < a href = "https://reactrouter.com" >
8+ the docs at reactrouter.com
9+ </ a >
10+ .
11+ </ p >
12+ ) ;
13+ }
You can’t perform that action at this time.
0 commit comments