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

Switch to stage-0 preset; Static variables are not permitted in components #227

Closed
TigerC10 opened this issue Jun 3, 2016 · 0 comments
Closed

Comments

@TigerC10
Copy link
Contributor

TigerC10 commented Jun 3, 2016

There's no support for static variables in the components, when I attempt to use static vars in my component classes here's what I get:

ERROR in ./src/components/MyComponent.js
Module build failed: SyntaxError: ./src/components/MyComponent.js: Unexpected token (14:19)
  12 | class MyComponent extends Component {
  13 |
> 14 |   static propTypes = {
     |                    ^
  15 |     myProp: PropTypes.string,
  16 |     otherProp: PropTypes.bool,
  17 |     awesomeProp: PropTypes.object,

I believe that switching to stage-0 (or even stage-1) instead of stage-2 will resolve the issue. Is there a reason the project is using stage-2?

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

1 participant