unistore icon indicating copy to clipboard operation
unistore copied to clipboard

Multiple Stores Overwrite on last store

Open adminy opened this issue 4 years ago • 0 comments

Rather than merging store with previous store I would like to have them separately. E.g.

const AuthStore = ({ children }) => <Provider store={pageStore}>{children}</Provider>
const PageStore = ({ children }) => <Provider store={authStore}>{children}</Provider>

render(
  <AuthStore>
    <PageStore>
       ...
    </PageStore>
  </AuthStore>
, document.body)

But currently when I try to use the stores in a component:

const A = connect('page', 'auth')(({ page, auth, children }) => (
     // page is defined but not auth
)

it seems like Page provider overwrites the Auth provider.

adminy avatar Dec 08 '21 15:12 adminy