atlassian/react-sweet-state

Nested scoped containers

anacierdem opened this issue · 2 comments

When global containers are nested, they share the global store instance;

<Container isGlobal>
    // The store instance here,
    <Container isGlobal>
        // is the same as this one
    </Container>
</Container>

The same is not true for nested scoped containers and I'd expect them to work similarly. e.g;

<Container scope="my-scope">
    // The store instance here,
    <Container scope="my-scope">
        // is NOT the same as this one
        // This should be consistent with global store behaviour
    </Container>
</Container>

Can you provide a code sandbox that reproduces the issue? I tried on the advanced-scope-flow example in this repo and state is shared and updated properly when the same container and scope are nested.

Sure let me try to create a minimal example.