Skip to content

Commit 0768baa

Browse files
committed
Merge pull request #3153 from reactjs/knowbody-patch-1
[docs] add explicit example on how to redirect using plain routes
2 parents 84bf2ae + cf7af89 commit 0768baa

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)