Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support in React v0.15.x with ES6-style classes #65

Open
stahlmanDesign opened this issue Mar 13, 2017 · 1 comment
Open

Support in React v0.15.x with ES6-style classes #65

stahlmanDesign opened this issue Mar 13, 2017 · 1 comment

Comments

@stahlmanDesign
Copy link

Just discovered this but can't get it to work in v15.4.2 with ES6-style classes. Since contextTypes are experimental in React I wondered if this library is still supported.

@casesandberg
Copy link
Owner

This will work just fine with ES6 classes as long as you wrap the export:

class SomeComponent extends React.Component {
  render() {
    <div>SomeComponent</div>
  }
}

export default context(SomeComponent)

While contextTypes are experimental, there is a lot of infrastructure built on them already (react-rexux) so there will definitely be something similar if it ever goes away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants