Skip to content

Commit 131ce76

Browse files
committed
Prefer React.createClass over react-mixin
1 parent b7b021c commit 131ce76

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

docs/guides/advanced/ConfirmingNavigation.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,7 @@ const Home = React.createClass({
2626
})
2727
```
2828

29-
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.
30-
31-
```js
32-
import reactMixin from 'react-mixin'
33-
import { Lifecycle } from 'react-router'
34-
35-
class Foo extends Component { /* ... */ }
36-
reactMixin(Foo.prototype, Lifecycle)
37-
38-
// or
39-
40-
@reactMixin.decorate(Lifecycle)
41-
class Bar extends Component { /* ... */ }
42-
```
29+
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, but we recommend using `React.createClass` for components that to set up router lifecycle hooks.
4330

4431
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.
4532

0 commit comments

Comments
 (0)