Redux

26 lessons

Achievements
Combined Shape@2x

The Certificate

avatar

Requests

A Redux store instance is created every time a new request takes action. The said store instance is made responsible for the initial state of your application.

In the midst of the rendering process, we’ll need to wrap the root component inside a <Provider>. This will permit all the components in the components tree to access the store.

The key step in server-side rendering is to render the initial HTML of our component before we send it to the client side. To do this, we use ReactDOMServer.renderToString().

We then get the initial state from our Redux store using store.getState(). We will see how this is passed along in our renderFullPage function.

In the code snippet above, we’ve created a store instance, rendered the components to String, and taken the initial state before sending the rendering page back to our client.