Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/master-detail/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ var App = React.createClass({
var contacts = this.state.contacts.map(function(contact) {
return <li key={contact.id}><Link to="contact" id={contact.id}>{contact.first}</Link></li>
});
var content = (this.props.activeRoute) ? this.props.activeRoute() : this.indexTemplate();
return (
<div className="App">
<div className="ContactList">
Expand All @@ -121,7 +120,7 @@ var App = React.createClass({
</ul>
</div>
<div className="Content">
{content}
{this.props.activeRoute() || this.indexTemplate()}
</div>
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions modules/components/Route.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var React = require('react');
var warning = require('react/lib/warning');
var invariant = require('react/lib/invariant');
var emptyFunction = require('react/lib/emptyFunction');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var mergeProperties = require('../helpers/mergeProperties');
var goBack = require('../helpers/goBack');
Expand Down Expand Up @@ -426,7 +427,7 @@ function computeHandlerProps(matches, query) {
key: null,
params: null,
query: null,
activeRoute: null
activeRoute: emptyFunction.thatReturnsNull
};

var childHandler;
Expand All @@ -443,7 +444,7 @@ function computeHandlerProps(matches, query) {
if (childHandler) {
props.activeRoute = childHandler;
} else {
props.activeRoute = null;
props.activeRoute = emptyFunction.thatReturnsNull;
}

childHandler = function (props, addedProps, children) {
Expand Down