I know react-redux@6 may not be supported. Please feel free to close if it is not supported.
Initially, we assign a store to <Provider store={ storeA }>. Then in the logic of a connected component, we call props.dispatch(), everything works fine.
Then we create a new store, namely storeB and switch to it thru <Provider store={ storeB }>. The subsequent props.dispatch() does not send actions to storeB but keep sending to storeA.
It does not repro on react-redux@^7.
You can find the live repro at https://codesandbox.io/embed/brave-leftpad-8bkfs.
npx create-react-app your-appnpm install redux react-redux@6 --savesrc/App.js as in CodeSandboxnpm startNotice after clicking "Increment" on step 8, the value did not change to 1.
If you click "Use store A", you will see the value changed to 2. It means the props.dispatch is being called on store A instead of B.
It should increment the value in store B to 1. The value in store A should still 1.
[email protected], [email protected][email protected][email protected][email protected][email protected] and [email protected]We're no longer supporting 6.0. You should use either 5.x or 7.x.
Most helpful comment
We're no longer supporting 6.0. You should use either 5.x or 7.x.