In my flux application, I have a DropDown React component that renders itself with an array of Key Value Pairs.
I'd like to have two different drop downs, one with Country Data, and another with City Data.
In the Flux pattern, each dropdown would have a Selection
Action that contains a payload of the selected value, which a corresponding store would use to update it's state.
How do I specify which dropdown Selection
action belongs to which store?
I can create a wrapper component that is specific to each need i.e. CountryDropDown
and CityDropDown
, and have each create their own specific action CountrySelected
and CitySelected
but is that the idiomatic approach? If it is, how do I wire up the underlying DropDown
component so that it's onChange
handler fires the parent's action?