componentWillMount and Reflux this.store don't play nice together.
See original GitHub issueI have an issue, using the ES6 Classes, if I have componentWillMount
on my React Component, then the component will not listen to the Store. Can we make both of them work?
Or at least show an error in case the Component doesn’t link to the Store.
I didn’t understood why the Component did not update with the Store’s state and eventually found out that if I have an componentWillMount, the Component will not be linked with the Store.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:12 (8 by maintainers)
Top Results From Across the Web
React Tutorial — Converting Reflux to Redux | by Matt Star
Reflux — the first attempt: Quick flux refresher from their docs: Following the Reflux pattern, let's declare an action–showFiltersActions–to tell the store ......
Read more >Understanding State in React Component - Morioh
In React, components are considered first-class citizens and therefore it is essential to be familiar with their inner working mechanism.
Read more >Functional Web Development with React and Redux
Yes, React is a small library that doesn't come with everything you might ... functions are named well and combined in a way...
Read more >Index - ReactJS Blueprints - Packt Subscription
Index. A. actions / Creating a data store to fetch the products. about / Understanding actions. alerts. about / Creating responsive alerts.
Read more >Untitled
Samsung 4s price in india, Lc270, Such a beautiful day film, Godhavi map, ... Biodata mawar febra, Asaps/aserf, Vb6 compare type, Play store...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eek I started reworking some of my old code last week to implement the new es6 features that @BryanGrezeszak was so nice to work on. I ran into some similar problems. If you have
componentWillMount
andcomponentWillUnmount
in yourReflux.Component
you need to add this line inside the function to make sure everything gets bound correctly:After the new docs were out I was going to check them over to make sure this got in there somewhere, as its easy to miss!
this
is a keyword too, but I can still log the object it references at any given moment. I expected similar behavior fromsuper
.Since I couldn’t access it I just thought that meant the feature wasn’t actually implemented. Oh well, live and learn: JS always has a surprise in store, no matter how much you think you know 😃
But yes, it should remove the need for any
call
. So that’s even better.