3 ms·
Yeah you definitely need Redux or another state management solution. One of the unorthodox practices React encourages (through the Flux architecture) is to have
by firasd 10y ago
Yeah you definitely need Redux or another state management solution. One of the unorthodox practices React encourages (through the Flux architecture) is to have 'global' state that components can access without passing down props all the time. Currently I limit setState usage to things that only the current component cares about, like if a button is disabled. Every event that may affect another component dispatches an update to the Redux store which holds the global state object.
Some Redux resources:
1) Getting Started with Redux, videos from its creator: https://egghead.io/series/getting-started-with-redux https://egghead.io/series/getting-started-with-redux
2) Simplest Redux example (including ES5): https://github.com/jackielii/simplest-redux-example https://github.com/jackielii/simplest-redux-example
3) I added Redux to the example app from the docs: https://medium.com/@firasd/quick-start-tutorial-using-redux-in-react-apps-89b142d6c5c1 https://medium.com/@firasd/quick-start-tutorial-using-redux-...
4) Offical Redux repo, including many examples https://github.com/reactjs/redux https://github.com/reactjs/redux