javascript - altjs react store connection not working -


i'm trying connect stores actual app in order provide data , react state changes. sadly though, store connection seems faulty.

 @connecttostores  class app extends component {       static getstores() {         return [categorystore, userstore, localizationstore];      }       static getpropsfromstores() {          return {             ...categorystore.getstate(),             ...userstore.getstate(),             ...localizationstore.getstate()      };    }      static componentdidconnect(props, context) {          ca.fetchcategories();          la.fetchlocales();      } 

the componentdidconnect never gets used when running project. according this: https://github.com/altjs/connect-to-stores/issues/6 function should run stores have been connected. had working partially putting action in componentwillmount, states aren't updated properly. think store connect isn't set properly.

i tried both es7 decorator / es6 normal implementation.

i have no clue why data stores isn't distributed. more welcome!

i figured out. reason why props weren't passed down childeren due following:

i used initialize children:

 const children = react.children.map(this.props.children, (child) => {   return react.cloneelement(child, this.state);  }); 

which passes down state not props. hence replacing this.state this.props worked me.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -