4 ms·
Don't implement Flux or Redux until you need it. This is what most React experts keep saying, but there are a ton of entry-level tutorials trying to teach both
by clay_to_n 10y ago
Don't implement Flux or Redux until you need it. This is what most React experts keep saying, but there are a ton of entry-level tutorials trying to teach both React concepts and Flux concepts (probably because it's a cool pattern). For most small apps, it's unnecessary. Pass state down as props.
- mparr4 10y agoThis. If your component hierarchy matches your application state hierarchy, don't use flux. If you need to pass pieces of state around to a bunch of different components (like sharing state across views), use flux. My first react application was complicated enough (enterprise analytics application) to require a flux implementation. I went redux and would highly recommend it both due to its ease-of-use and popularity. However, in subsequent applications I haven't needed it and have enjoyed writing vanilla react.
- level 10y agoBut also recognize when you'll need it, before you need it. I'm working on a React Native application without Flux, and it's turned into a massive roadblock because there's no concept of unidirectional data flow. Passing state up, down, and trying to sync it between components has become a mess and has lead to very tightly coupled components.