reduxjs / redux

A JS library for predictable global state management
https://redux.js.org
MIT License
60.51k stars 15.26k forks source link

[DOCS] replace root reducer with persisted reducer #4659

Closed SKorchinskiy closed 4 months ago

SKorchinskiy commented 4 months ago

Documentation Fix Fixing a problem in an existing docs page

What docs page needs to be fixed?

What is the problem?

At the end of the section "Store Setup with configureStore" the "Detailed Example: Custom Store Setup with Persistence and Middleware" example is given which uses Redux-Persist library. In the example configureStore's reducer is provided with rootReducer which is ambiguous due to the fact that persistor will be typically created after based on the created store. However, for example, when the persistor will be given to the PersistGate component, the app won't work as expected.

What changes does this PR make to fix the problem?

The code in the PR changes rootReducer in the configureStore to be persistedReducer

codesandbox-ci[bot] commented 4 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d58cc3aaba8a3aa900421a19883d1610a411e3e3:

Sandbox Source
Vanilla Typescript Configuration
netlify[bot] commented 4 months ago

Deploy Preview for redux-docs ready!

Name Link
Latest commit d58cc3aaba8a3aa900421a19883d1610a411e3e3
Latest deploy log https://app.netlify.com/sites/redux-docs/deploys/659ee42ae06382000808f2e1
Deploy Preview https://deploy-preview-4659--redux-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

timdorr commented 4 months ago

Thanks!