4 ms·
I'd also add that in general we suggest there to be one source of truth for any data. For any particular data, you could put it in Redux -or- in local state, bu
by danabramov 9y ago
I'd also add that in general we suggest there to be one source of truth for any data. For any particular data, you could put it in Redux -or- in local state, but there is rarely a need to keep it in both.
Manually copying things from Redux into local state from `componentWillReceiveProps` (or even with new `getDerivedStateFromProps`) seems unnecessary to me. There are exceptions like rare cases where you want to have a “draft” of some state that can later be “reverted”. But in general you wouldn't want to “sync” state from one source to another.