@@ -113,21 +113,6 @@ since its simple with a `*` path.
113
113
< Link to= {` /users/${ user .id } ` }> Mateusz< / Link>
114
114
```
115
115
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
-
131
116
#### "active" class
132
117
133
118
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.
173
158
< IndexLink to= " /" > Home< / IndexLink>
174
159
```
175
160
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
+
176
176
### Navigation Mixin
177
177
178
178
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
269
269
router and will be doing that very soon, before the 1.0 final release,
270
270
but it doesn't need to be baked into routing like it was before.
271
271
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
+
272
298
### We'll keep updating this
273
299
274
300
There's a lot of the old API we've missed, please give the [ new
0 commit comments