@@ -97,7 +97,7 @@ import {
97
97
98
98
// 3️⃣ Router singleton created
99
99
const router = createBrowserRouter ([
100
- { path: " *" , Component: Root },
100
+ { path: " *" , element: < Root /> },
101
101
]);
102
102
103
103
// 4️⃣ RouterProvider added
@@ -133,12 +133,12 @@ function UserApp() {
133
133
134
134
### Start lifting routes and leveraging the data APIs
135
135
136
- Let's start with the ` / ` route for the ` <Home> ` component . All we need to do is lift the ` <Route> ` definition up to the data router:
136
+ Let's start with the ` / ` route for the ` <Home> ` element . All we need to do is lift the ` <Route> ` definition up to the data router:
137
137
138
138
``` tsx lines=[2,13]
139
139
const router = createBrowserRouter ([
140
- { path: " /" , Component: Home }, // 🆕
141
- { path: " *" , Component: Root },
140
+ { path: " /" , element: < Home /> }, // 🆕
141
+ { path: " *" , element: < Root /> },
142
142
]);
143
143
144
144
export default function App() {
@@ -162,18 +162,18 @@ Now let's look at lifting the Blog App upwards, but still doing it one leaf rout
162
162
163
163
``` tsx lines=[3-12,23,32]
164
164
const router = createBrowserRouter ([
165
- { path: " /" , Component: Home },
165
+ { path: " /" , element: < Home /> },
166
166
{
167
167
// Lifted blog splat route
168
168
path: " /blog/*" ,
169
169
children: [
170
170
// New blog index route
171
- { index: true , Component : () => <h1 >Blog Index</h1 > },
171
+ { index: true , element: <h1 >Blog Index</h1 > },
172
172
// Blog subapp splat route added for /blog/posts matching
173
- { path: " *" , Component: BlogApp },
173
+ { path: " *" , element: < BlogApp /> },
174
174
],
175
175
},
176
- { path: " *" , Component: Root },
176
+ { path: " *" , element: < Root /> },
177
177
]);
178
178
179
179
export default function App() {
0 commit comments