Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] overmind-react - multiple overmind named instances #571

Open
nkint opened this issue Nov 20, 2022 · 1 comment
Open

[BUG] overmind-react - multiple overmind named instances #571

nkint opened this issue Nov 20, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@nkint
Copy link

nkint commented Nov 20, 2022

Hi!
Thanks for the great library.

The documentations says here:

If you have multiple instances of Overmind on the same page you can name your app to differentiate them

But it's not clear to me how to correctly achieve this.

I want two separate states, and I created for each one of them a state/actions/config + a createOvermind method+ React hooks + a Provider.
Only one of them is correctly read by the component that needs data from both overmind instances.
Here there is a dumb example to reproduce the problem:
https://codesandbox.io/s/overmind-multiple-named-instances-forked-i5biot?file=/src/index.tsx

I'm sure I'm doing it wrong but documentations lacks or there is a bug.
I understand that I can use namespace but it doesn't fit my case.

@nkint nkint added the bug Something isn't working label Nov 20, 2022
@nkint nkint changed the title [BUG] multiple overmind named instances [BUG] overmind-react - multiple overmind named instances Nov 21, 2022
@nkint
Copy link
Author

nkint commented Nov 21, 2022

I think that the problem relies in overmind-react and in how react context works.

This can be seen as a related problem: #477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants