usepropeller/react.backbone — pull request #12 by EtienneLem (2014-03-09 19:27:11+00:00)
Title: Add `changeModel` lifecycle methods to React

Given [this basic example](https://gist.github.com/EtienneLem/62e02d28eec6a7064ec1).

## Before
```rb
- click "show model 1"
# => c1 componentDidMount

- click "update model 1"
# => c1 componentDidUpdate

- click "show model 2"
# => c2 componentDidUpdate

- click "update model 2"
# => c2 componentDidUpdate
```

**The problem:** I need to be able to store `c1` data when clicking another model (but it’ll never be unmounted). `componentWillUpdate` isn’t the lifecycle method that I’m looking for. I also need to be able to restore `c1` data when navigating back to it (hence the before and after change hooks).

## After
```rb
- click "show model 1"
# => c1 componentDidMount

- click "update model 1"
# => c1 componentDidUpdate

- click "show model 2"
# => c1 componentWillChangeModel
# => c2 componentDidUpdate
# => c2 componentDidChangeModel

- click "update model 2"
# => c2 componentDidUpdate
```

In other words, these kinda are sort of `mount` & `unmount` lifecycle methods for component that will never `unmount` even when rendering a new model.