You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -460,7 +460,18 @@ All the same props as [Route](#route) except for `path`.
460
460
### `<IndexRedirect>`
461
461
An `<IndexRedirect>` allows you to redirect from the URL of a parent route to another route. They can be used to allow a child route to serve as the default route for its parent, while still keeping a distinct URL.
462
462
463
-
Please see the [Index Routes guide](/docs/guides/IndexRoutes.md).
463
+
#### Example
464
+
```js
465
+
<Router>
466
+
<Route path="/" component={App}>
467
+
<IndexRedirect to="groups"/>
468
+
{/* If no child route is matched, will redirect to 'groups' */}
469
+
470
+
<Route path="groups" component={Groups} />
471
+
<Route path="users" component={Users} />
472
+
</Route>
473
+
</Router>
474
+
```
464
475
465
476
#### Props
466
477
All the same props as [Redirect](#redirect) except for `from`.
0 commit comments