Skip to content

Add "default route" handler #164

Closed
@mjackson

Description

@mjackson

Proposal: <Route defaultRouteHandler> specifies a route handler that is rendered when a route matches on the path but none of its children do. It is akin to Ember's "index" routes and gives us a declarative way to specify a default handler for a route instead of using

render: function () {
  return this.props.activeRouteHandler() || somethingElse();
}

You use it like this.

In addition, when a route uses defaultRouteHandler, the value of this.props.activeRouteHandler should automatically use it so the user can write

render: function () {
  return this.props.activeRouteHandler();
}

instead of

render: function () {
  return this.props.activeRouteHandler() || this.props.defaultRouteHandler();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestUsed to close PRs that haven't gone through/been accepted the Proposal process yet

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions