Skip to content
Merged
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
15 changes: 15 additions & 0 deletions docs/guides/advanced/ConfirmingNavigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ const Home = React.createClass({
})
```

If you are using ES6 classes for your components, you can use [react-mixin](https://github.com/brigand/react-mixin) to add the `Lifecycle` mixin to your component.

```js
import reactMixin from 'react-mixin'
import { Lifecycle } from 'react-router'

class Foo extends Component { /* ... */ }
reactMixin(Foo.prototype, Lifecycle)

// or

@reactMixin.decorate(Lifecycle)
class Bar extends Component { /* ... */ }
```

If you need a [`routerWillLeave`](/docs/API.md#routerwillleavenextlocation) hook in a deeply nested component, simply use the [`RouteContext`](/docs/API.md#routecontext-mixin) mixin in your [route component](/docs/Glossary.md#routecomponent) to put the `route` in context.

```js
Expand Down