3 ms·
As someone who's mainly just used react for simple components, when is the right time to think about pulling in redux? I'm getting by with just react, but it se
by losvedir 11y ago
As someone who's mainly just used react for simple components, when is the right time to think about pulling in redux? I'm getting by with just react, but it seems like at some complexity level everyone recommends a flux library (and mostly redux these days). Is it when you have multiple component trees on the page? When AJAX requests are involved? Or do people familiar with redux just drop it in from the very start even on simple components?
- insin 11y agoDan Abramov wrote a blog post a while back with a bunch of "You might need Flux if..." use cases, which might be handy: https://medium.com/swlh/the-case-for-flux-379b7d1982c6 https://medium.com/swlh/the-case-for-flux-379b7d1982c6
- jroitgrund 11y agoIt makes everything easier to test and reason about at the cost of little overhead (wrap your top-level routing components with 'connect', add a <Provider></Provider> wrapper around your <Router>). If you already have a lot of behavior defined it might take a little while to convert it all to reducers (action + currentState -> newState functions) but it's a pretty simple refactor.