-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Initializing an observable class property in component constructor #384
Comments
using babel? what does your import statement in app container look like? Op ma 4 jul. 2016 17:07 schreef hyperh notifications@github.com:
|
@mweststrate Yes, using babel. I can't tell what If I take out the constructor, the app runs fine. I just won't be able to properly initialize the observable based on the initial props then. But in terms of which component is importing this problematic component, here's the code
|
@mweststrate I figured it out. I had strict mode enabled. The following code works, but it's a bit ugly. I just noticed that article is yours haha. Perhaps update it to point out possible issues following it if you are using strict mode. Great article by the way!
|
Looks fine. Usually this error refers to an import / export issue (using a Op ma 4 jul. 2016 om 17:15 schreef hyperh notifications@github.com:
|
Ah yeas, there is an open issue for that, see #338 |
Following this article: https://medium.com/@mweststrate/3-reasons-why-i-stopped-using-react-setstate-ab73fc67a42e#.hzcbmc5r8. Specifically this gist
I get the following errors
Here's my code. I'm using Webpack if that matters.
I would like to initialize
this.matches
depending on the values ofthis.props.items
.The text was updated successfully, but these errors were encountered: