4 ms·
This is what confuses me. How would I write a React based component that can manage the retrieving the data it needs and can be easily integrated into other Rea
by stevewilhelm 10y ago
This is what confuses me. How would I write a React based component that can manage the retrieving the data it needs and can be easily integrated into other React/Redux based applications.
For example, I wish to write a component that displays the weather for a given date and zip code. I also want to create another component that displays the local events for a given date and zip code.
I want a simple SPA app to include these two components along with a shared chooser component that allows users to select the zip code and date.
Finally, I want to share the weather and event components with other developers so they can incorporate them easily in their own React/Redux based applications.
- eiriklv 10y agoThis is a good read [0]. Been using this approach in several larger applications for a while (with great success). By decoupling the selection of state from the actual state structure (using relative selectors) + defining a public interface for your features (your app will basically consist of smaller apps - fractally) you can achieve what you're after. [0] http://jaysoo.ca/2016/02/28/organizing-redux-application/ http://jaysoo.ca/2016/02/28/organizing-redux-application/