Skip to content

Commit cf7af89

Browse files
committed
[docs] add explicit example on how to redirect using plain routes
1 parent 84bf2ae commit cf7af89

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/guides/RouteConfiguration.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,16 @@ const routeConfig = [
205205

206206
render(<Router routes={routeConfig} />, document.body)
207207
```
208+
209+
### Redirect using plain routes configuration
210+
211+
```js
212+
const routes = [{
213+
path: '/',
214+
component: Home,
215+
onEnter: (nextState, replace) => replace('/about')
216+
}, {
217+
path: '/about',
218+
component: About
219+
}]
220+
```

0 commit comments

Comments
 (0)