In terms of Redux, is the view render what triggers the store to set up the initial sate? Or is the store initially set up first anyway?

It would be:

Initial store set up -> Access store state -> View render -> Display UI

Looking into this code:

ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById("root")
);
  1. (Initial Store Setup): The store is first created via createStore(). Here, the entire application state tree is created.

  2. (Access store state): mapping it as props via mapStateToProps(). React would need to know the state and props required for this component to render correctly.

  3. (View Render): Then React would call the component’s render() or the return of functional components.

  4. (Display UI): Then this output is mounted in the DOM or updated for state changes (cycles back to Step 2).

See React’s lifecycle recap as reference.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top