Skip to content

Commit

Permalink
Merge pull request #3153 from reactjs/knowbody-patch-1
Browse files Browse the repository at this point in the history
[docs] add explicit example on how to redirect using plain routes
  • Loading branch information
taion committed Mar 5, 2016
2 parents 84bf2ae + cf7af89 commit 0768baa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/guides/RouteConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,16 @@ const routeConfig = [

render(<Router routes={routeConfig} />, document.body)
```

### Redirect using plain routes configuration

```js
const routes = [{
path: '/',
component: Home,
onEnter: (nextState, replace) => replace('/about')
}, {
path: '/about',
component: About
}]
```

0 comments on commit 0768baa

Please sign in to comment.