@@ -231,6 +231,34 @@ Route({handler: App},
231
231
232
232
Paths are not inherited from parent routes.
233
233
234
+ ### Link (Component)
235
+
236
+ Creates an anchor tag that links to a route in the application. Also
237
+ gets the ` active ` class automatically when the route matches. If you
238
+ change the path of your route, you don't have to change your links.
239
+
240
+ #### Properties
241
+
242
+ ** to** - The name of the route to link to.
243
+
244
+ ** query** - Object, Query parameters to add to the link. Access query
245
+ parameters in your route handler with ` this.props.query ` .
246
+
247
+ ** [ param] ** - Any parameters the route defines are passed by name
248
+ through the link's properties.
249
+
250
+ #### Example
251
+
252
+ Given a route like ` <Route name="user" path="/users/:userId"/> ` :
253
+
254
+ ``` xml
255
+ <Link to =" user" userId ={user.id} params ={{foo: bar}}>{user.name}</Link >
256
+ <!-- becomes one of these depending on your router and if the route is
257
+ active -->
258
+ <a href =" /users/123?foo=bar" class =" active" >Michael</a >
259
+ <a href =" #/users/123?foo=bar" >Michael</a >
260
+ ```
261
+
234
262
### Handlers
235
263
236
264
There are some properties and hooks available to the handlers you pass
@@ -299,31 +327,6 @@ var Settings = React.createClass({
299
327
});
300
328
```
301
329
302
- ### Link (Component)
303
-
304
- Creates an anchor tag that links to a route in the application. Also
305
- gets the ` active ` class automatically when the route matches. If you
306
- change the path of your route, you don't have to change your links.
307
-
308
- #### Properties
309
-
310
- ** to** - The name of the route to link to.
311
-
312
- ** [ param] ** - Any parameters the route defines are passed by name
313
- through the link's properties.
314
-
315
- #### Example
316
-
317
- Given a route like ` <Route name="user" path="/users/:userId"/> ` :
318
-
319
- ``` xml
320
- <Link to =" user" userId ={user.id}>{user.name}</Link >
321
- <!-- becomes one of these depending on your router and if the route is
322
- active -->
323
- <a href =" /users/123" class =" active" >Michael</a >
324
- <a href =" #/users/123" >Michael</a >
325
- ```
326
-
327
330
Development
328
331
-----------
329
332
0 commit comments