4 ms·
I'm already using immutable objects, this is a separate issue. The question is about how to keep the UIState (Say inside a component) in sync with the AppState
by d0m 10y ago
I'm already using immutable objects, this is a separate issue. The question is about how to keep the UIState (Say inside a component) in sync with the AppState considering they both evolve differently?
- acgourley 10y agoThe official Redux answer way is to use app state for everything. See libraries like https://github.com/erikras/redux-form https://github.com/erikras/redux-form which move all the field state into your app state. Personally I break that rule when I know I can. The only other state I can think of is animation state - but using css transition animations has just worked out for me so far.
- acemarke 10y agoActually, no, it's not. In fact, the Redux FAQ flat-out says "It's up to you to decide what state goes where": http://redux.js.org/docs/FAQ.html#organizing-state-only-redux-state http://redux.js.org/docs/FAQ.html#organizing-state-only-redu.... There's certainly some good reasons to put as much of your UI/app state into Redux as possible, but there's also entirely valid reasons why you might not want to put some state in there.