Skip to content

Commit dc786c9

Browse files
authored
Fix v6 data API migration guideline docs (#11492)
1 parent ec03b12 commit dc786c9

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
- mikib0
178178
- minami-minami
179179
- minthulim
180+
- mlewando
180181
- modex98
181182
- morleytatro
182183
- ms10596

docs/upgrading/v6-data.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ import {
9797

9898
// 3️⃣ Router singleton created
9999
const router = createBrowserRouter([
100-
{ path: "*", Component: Root },
100+
{ path: "*", element: <Root /> },
101101
]);
102102

103103
// 4️⃣ RouterProvider added
@@ -133,12 +133,12 @@ function UserApp() {
133133

134134
### Start lifting routes and leveraging the data APIs
135135

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:
137137

138138
```tsx lines=[2,13]
139139
const router = createBrowserRouter([
140-
{ path: "/", Component: Home }, // 🆕
141-
{ path: "*", Component: Root },
140+
{ path: "/", element: <Home /> }, // 🆕
141+
{ path: "*", element: <Root /> },
142142
]);
143143

144144
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
162162

163163
```tsx lines=[3-12,23,32]
164164
const router = createBrowserRouter([
165-
{ path: "/", Component: Home },
165+
{ path: "/", element: <Home /> },
166166
{
167167
// Lifted blog splat route
168168
path: "/blog/*",
169169
children: [
170170
// New blog index route
171-
{ index: true, Component: () => <h1>Blog Index</h1> },
171+
{ index: true, element: <h1>Blog Index</h1> },
172172
// Blog subapp splat route added for /blog/posts matching
173-
{ path: "*", Component: BlogApp },
173+
{ path: "*", element: <BlogApp /> },
174174
],
175175
},
176-
{ path: "*", Component: Root },
176+
{ path: "*", element: <Root /> },
177177
]);
178178

179179
export default function App() {

0 commit comments

Comments
 (0)