You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm loving emitter based state management via smitty so far. My biggest roadblock at the moment is that I can't simply do something like
<Component amount={amount.state.value} />
and expect Component to update when value changes, like we could via redux props. At the moment I need to use state and add a lot of amount.on(SOMETHING) listeners that then call functions to update that state hence re-rendering component with new values. Furthermore I need to remember to always do amount.off during un-mounting.
This brings me to reason behind this question. Can you advise what could be done here in order to achieve this i.e. something like mapStateToProps but using smitty?
The text was updated successfully, but these errors were encountered:
xzilja
changed the title
Advice on triggering re-render of components when state changes
[Advice needed] on triggering re-render of components when state changes
Jan 31, 2017
I'm loving emitter based state management via smitty so far. My biggest roadblock at the moment is that I can't simply do something like
and expect
Component
to update whenvalue
changes, like we could via redux props. At the moment I need to usestate
and add a lot ofamount.on(SOMETHING)
listeners that then call functions to update that state hence re-rendering component with new values. Furthermore I need to remember to always doamount.off
during un-mounting.This brings me to reason behind this question. Can you advise what could be done here in order to achieve this i.e. something like
mapStateToProps
but using smitty?The text was updated successfully, but these errors were encountered: