rackt/react-router — pull request #322 by jonasi (2014-09-27 23:07:13+00:00)
Title: added <ReplaceWith /> and <TransitionTo /> components

#### Description

This pr adds a couple of helper components that make dealing with transitioning in complex components a little easier. The two components, `` and `` expect to be rendered and will trigger their respective `Router` actions.

In a component that manages a fair amount of async state, I often find myself rendering different pieces of content in response to the different states of my data (e.g. spinner when data is loading, alerts when in error state, normal otherwise). Sometimes, I need to move to a completely different page in response to what the data tells me (think redirecting to login when checking the server for auth state). Instead of having that state inspection logic in `componentDidUpdate` and another set of data state inspection logic in `render`, these components let me unify that logic in the `render` method.

#### Usage

```
if (this.state.disallowed) {
return ;
}

return
```