diff --git a/docs/api/Router.md b/docs/api/Router.md index 7b51f3641e..64d564ab72 100644 --- a/docs/api/Router.md +++ b/docs/api/Router.md @@ -51,3 +51,16 @@ entry from the browser history. Router.goBack(); ``` +### `makeHref(routeName, params, query)` + +Creates an `href` to a route. Use this along with `ActiveState` when you +need to build components similar to `Link`. + +#### Example + +```js +// given a route like this: + +Router.makeHref('user', {userId: 123}); // "users/123" +``` + diff --git a/index.js b/index.js index d2ccce8e4c..17fb46cff3 100644 --- a/index.js +++ b/index.js @@ -6,3 +6,4 @@ exports.Routes = require('./Routes'); exports.goBack = require('./goBack'); exports.replaceWith = require('./replaceWith'); exports.transitionTo = require('./transitionTo'); +exports.makeHref = require('./makeHref'); diff --git a/makeHref.js b/makeHref.js new file mode 100644 index 0000000000..d8eecd3a01 --- /dev/null +++ b/makeHref.js @@ -0,0 +1 @@ +module.exports = require('./modules/helpers/makeHref');