These are chat archives for reflux/refluxjs

17th
Jun 2015
Simon Polak
@smnplk
Jun 17 2015 14:24
Howdy all! Just a quick question. I have a use case when I have to set dropdowns to some default value when React component is mounted, so in componentDidMount callback...but I also track selected values in store, so I have to also trigger an action that sets those default values in the store, but i don't want to call this.trigger inside that action because i don't need rerendering to occur for this.. Is this ok approach ? Or maybe I am overcomplicated, maybe I should set the default values in the store initializer and then render dropdowns based on that...
Yepp, I think I should go with my second approach here, to set up the state of dropdowns in getInitialState inside my store..
Talking to myself sometimes helps :)
Simon Polak
@smnplk
Jun 17 2015 14:33
Just to clarify, the default data comes from the server, so It's not something i know in advance, so the approproate place to change the state of my store is in my onLoadInitData action...