Quantcast
Channel: Initial Load of Data for Different React Container Components - Redux - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Initial Load of Data for Different React Container Components - Redux

$
0
0

I'm using react-redux.

When you have various pages on your site such as list of companies, list of jobs, etc. and lets say you have top level containers for those such as <CompanyList /> and <JobList />, in your component where do you make that dispatch call? Usually in containers you only call dispatch for handlers.

Reducers specify initial state. But what if I have several types of pages and entities in my app? Trying to figure out how just rendering a read only list is orchestrated amongst different type of Container components in an app.

When you first create the store you have the option to specify initial state there, but I'm just saying do it in the reducer. So lets say for <CompanyList /> how does it know where to grab initial state..in my mapDispatchToProps is that where I'd call dispatch or something with say an action such as "GET_ALL" for companies?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>