Skip to content

Commit 87e920f

Browse files
committed
add note about transitions
closes #1931
1 parent 14d0e8f commit 87e920f

File tree

1 file changed

+41
-15
lines changed

1 file changed

+41
-15
lines changed

UPGRADE_GUIDE.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,6 @@ since its simple with a `*` path.
113113
<Link to={`/users/${user.id}`}>Mateusz</Link>
114114
```
115115

116-
### RouteHandler
117-
118-
`RouteHandler` is gone. `Router` now automatically populates
119-
`this.props.children` of your components based on the active route.
120-
121-
```js
122-
// v0.13.x
123-
<RouteHandler/>
124-
<RouteHandler someExtraProp={something}/>
125-
126-
// v1.0
127-
{this.props.children}
128-
{React.cloneElement(this.props.children, {someExtraProp: something })}
129-
```
130-
131116
#### "active" class
132117

133118
In 0.13.x links added the "active" class by default which you could
@@ -173,6 +158,21 @@ active when the index route is active.
173158
<IndexLink to="/">Home</IndexLink>
174159
```
175160

161+
### RouteHandler
162+
163+
`RouteHandler` is gone. `Router` now automatically populates
164+
`this.props.children` of your components based on the active route.
165+
166+
```js
167+
// v0.13.x
168+
<RouteHandler/>
169+
<RouteHandler someExtraProp={something}/>
170+
171+
// v1.0
172+
{this.props.children}
173+
{React.cloneElement(this.props.children, {someExtraProp: something })}
174+
```
175+
176176
### Navigation Mixin
177177

178178
If you were using the `Navigation` mixin, use the `History` mixin instead.
@@ -269,6 +269,32 @@ we've realized that we can build a better implementation on top of the
269269
router and will be doing that very soon, before the 1.0 final release,
270270
but it doesn't need to be baked into routing like it was before.
271271

272+
### `willTransitionTo` and `willTransitionFrom`
273+
274+
Routes now define this behavior:
275+
276+
```js
277+
// v0.13.x
278+
var Home = React.createClass({
279+
statics: {
280+
willTransitionTo (transition, params, query, callback) {
281+
}
282+
willTransitionFrom (component, transition, params, query, callback) {
283+
}
284+
}
285+
})
286+
287+
// v1.0
288+
<Route
289+
component={Home}
290+
onEnter={(location, replaceWith) => {}}
291+
onLeave={() => {}}
292+
/>
293+
```
294+
295+
To cancel a "transition from", please refer to the
296+
[Confirming Navigation](docs/advanced/ConfirmingNavigation.md) guide.
297+
272298
### We'll keep updating this
273299

274300
There's a lot of the old API we've missed, please give the [new

0 commit comments

Comments
 (0)