From 58e7b983515c47a0f1488fc14d8880f94293f5ea Mon Sep 17 00:00:00 2001 From: Ryan Florence Date: Tue, 22 Jul 2014 13:20:37 -0600 Subject: [PATCH] [changed] activeRoute -> activeRouteHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit its not really the route component, but rather the active route’s handler --- README.md | 14 +++++++------- examples/auth-flow/app.js | 2 +- examples/data-flow/app.js | 2 +- examples/dynamic-segments/app.js | 4 ++-- examples/master-detail/app.js | 2 +- examples/partial-app-loading/app.js | 2 +- examples/partial-app-loading/dashboard.js | 2 +- examples/query-params/app.js | 2 +- examples/shared-root/app.js | 6 +++--- examples/simple-master-detail/app.js | 2 +- examples/transitions/app.js | 2 +- modules/components/Route.js | 10 +++++----- specs/Route.spec.js | 2 +- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 1fa2f8252b..b49269aaa8 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ var App = React.createClass({
  • Users
  • User 123
  • - + ); } @@ -103,7 +103,7 @@ var Users = React.createClass({ return (

    Users

    - +
    ); } @@ -116,7 +116,7 @@ var User = React.createClass({ }); ``` -To better understand what is happening with `activeRoute` perhaps an +To better understand what is happening with `activeRouteHandler` perhaps an example without the router will help. Lets take the scenario where `/users/2` has been matched. Your render method, without this router, might look something like this: @@ -124,8 +124,8 @@ might look something like this: ```js render: function() { var user = ; - var users = ; - return ; + var users = ; + return ; } ``` @@ -190,7 +190,7 @@ routes do not inherit the path of their parent. Routes can be nested. When a child route matches, the parent route's handler will have an instance of the child route's handler available as -`this.props.activeRoute()`. You can then render it in the parent +`this.props.activeRouteHandler()`. You can then render it in the parent passing in any additional props as needed. #### Examples @@ -225,7 +225,7 @@ props and static methods available to these components. #### Props -**this.props.activeRoute(extraProps)** - The active child route handler. +**this.props.activeRouteHandler(extraProps)** - The active child route handler. Use it in your render method to render the child route, passing in additional properties as needed. diff --git a/examples/auth-flow/app.js b/examples/auth-flow/app.js index 91b17166c9..5ce0edcdb4 100644 --- a/examples/auth-flow/app.js +++ b/examples/auth-flow/app.js @@ -34,7 +34,7 @@ var App = React.createClass({
  • About
  • Dashboard (authenticated)
  • - {this.props.activeRoute()} + {this.props.activeRouteHandler()()} ); } diff --git a/examples/data-flow/app.js b/examples/data-flow/app.js index becfeba2ca..d87ebdb955 100644 --- a/examples/data-flow/app.js +++ b/examples/data-flow/app.js @@ -41,7 +41,7 @@ var App = React.createClass({ {links}
    - {this.props.activeRoute({onRemoveTaco: this.handleRemoveTaco})} + {this.props.activeRouteHandler({onRemoveTaco: this.handleRemoveTaco})}
    ); diff --git a/examples/dynamic-segments/app.js b/examples/dynamic-segments/app.js index 447542fa68..5906e82b66 100644 --- a/examples/dynamic-segments/app.js +++ b/examples/dynamic-segments/app.js @@ -12,7 +12,7 @@ var App = React.createClass({
  • Bob
  • Sally
  • - {this.props.activeRoute()} + {this.props.activeRouteHandler()} ); } @@ -27,7 +27,7 @@ var User = React.createClass({
  • foo task
  • bar task
  • - {this.props.activeRoute()} + {this.props.activeRouteHandler()} ); } diff --git a/examples/master-detail/app.js b/examples/master-detail/app.js index d87c46f850..15d2a302dc 100644 --- a/examples/master-detail/app.js +++ b/examples/master-detail/app.js @@ -120,7 +120,7 @@ var App = React.createClass({
    - {this.props.activeRoute() || this.indexTemplate()} + {this.props.activeRouteHandler() || this.indexTemplate()}
    ); diff --git a/examples/partial-app-loading/app.js b/examples/partial-app-loading/app.js index a796396430..c8051c8ea7 100644 --- a/examples/partial-app-loading/app.js +++ b/examples/partial-app-loading/app.js @@ -52,7 +52,7 @@ var App = React.createClass({
    • Dashboard
    - {this.props.activeRoute()} + {this.props.activeRouteHandler()} ); } diff --git a/examples/partial-app-loading/dashboard.js b/examples/partial-app-loading/dashboard.js index e77c123e86..f910cd6ea5 100644 --- a/examples/partial-app-loading/dashboard.js +++ b/examples/partial-app-loading/dashboard.js @@ -13,7 +13,7 @@ var Dashboard = React.createClass({
    • Inbox
    - {this.props.activeRoute()} + {this.props.activeRouteHandler()} ); } diff --git a/examples/query-params/app.js b/examples/query-params/app.js index 613e6c3517..353c1c1498 100644 --- a/examples/query-params/app.js +++ b/examples/query-params/app.js @@ -13,7 +13,7 @@ var App = React.createClass({
  • Bob With Query Params
  • Sally
  • - {this.props.activeRoute()} + {this.props.activeRouteHandler()} ); } diff --git a/examples/shared-root/app.js b/examples/shared-root/app.js index b969f24155..38451321ba 100644 --- a/examples/shared-root/app.js +++ b/examples/shared-root/app.js @@ -13,7 +13,7 @@ var App = React.createClass({
  • Sign in
  • Forgot Password
  • - {this.props.activeRoute()} + {this.props.activeRouteHandler()} ); } @@ -24,7 +24,7 @@ var SignedIn = React.createClass({ return (

    Signed In

    - {this.props.activeRoute()} + {this.props.activeRouteHandler()}
    ); } @@ -43,7 +43,7 @@ var SignedOut = React.createClass({ return (

    Signed Out

    - {this.props.activeRoute()} + {this.props.activeRouteHandler()}
    ); } diff --git a/examples/simple-master-detail/app.js b/examples/simple-master-detail/app.js index adfbb19b89..d320afe4dc 100644 --- a/examples/simple-master-detail/app.js +++ b/examples/simple-master-detail/app.js @@ -23,7 +23,7 @@ var App = React.createClass({ {links}
    - {this.props.activeRoute() || this.indexTemplate()} + {this.props.activeRouteHandler() || this.indexTemplate()}
    ); diff --git a/examples/transitions/app.js b/examples/transitions/app.js index fca1ee4f95..c14c7b1cfb 100644 --- a/examples/transitions/app.js +++ b/examples/transitions/app.js @@ -12,7 +12,7 @@ var App = React.createClass({
  • Dashboard
  • Form
  • - {this.props.activeRoute() ||

    Home

    } + {this.props.activeRouteHandler() ||

    Home

    } ); } diff --git a/modules/components/Route.js b/modules/components/Route.js index 08b946807c..1b075e60dd 100644 --- a/modules/components/Route.js +++ b/modules/components/Route.js @@ -69,13 +69,13 @@ var REF_NAME = '__activeRoute__'; * ), document.body); * * Handlers for Route components that contain children can render their active - * child route using the activeRoute prop. + * child route using the activeRouteHandler prop. * * var App = React.createClass({ * render: function () { * return ( *
    - * {this.props.activeRoute()} + * {this.props.activeRouteHandler()} *
    * ); * } @@ -445,7 +445,7 @@ function computeHandlerProps(matches, query) { key: null, params: null, query: null, - activeRoute: emptyFunction.thatReturnsNull + activeRouteHandler: emptyFunction.thatReturnsNull }; var childHandler; @@ -460,9 +460,9 @@ function computeHandlerProps(matches, query) { props.query = query; if (childHandler) { - props.activeRoute = childHandler; + props.activeRouteHandler = childHandler; } else { - props.activeRoute = emptyFunction.thatReturnsNull; + props.activeRouteHandler = emptyFunction.thatReturnsNull; } childHandler = function (props, addedProps) { diff --git a/specs/Route.spec.js b/specs/Route.spec.js index abf20b8f1c..b6517e4371 100644 --- a/specs/Route.spec.js +++ b/specs/Route.spec.js @@ -134,7 +134,7 @@ describe('a child route', function() { // var dataStore = 'goodbye'; // var Layout = React.createClass({ // render: function() { -// return React.DOM.article(null, this.props.activeRoute()); +// return React.DOM.article(null, this.props.activeRouteHandler()); // } // }); // var AsyncApp = React.createClass({