Closed sebald closed 2 years ago
Could this be a solution to the problem (in useTheme.tsx) since we are stacking the providers there?
Not quite, the lib solved a problem before hooks existed (requiring multiple context consumers). This is why it is deprecated now.
The solution is actually much simpler and stupid 😄
@sebald Should I just try to check if the provider is there before adding it?
@sebald Should I just try to check if the provider is there before adding it?
@ti10le that's one solution, but how do you check that? 🙂
If it is possible at all I have to find out first 😀
@sebald How do you see that OverlayProvider added multiple times? I can only see this in devTools. Looks like theres only one time:
See description -> cascading
Ok now I get it. @sebald we have just asked ourselves the question whether we now only use the MarigoldProvider or also the ThemeProvider if we want to cascade e.g. only the theme?
My gut says <MarigoldProvider>
since most users will only use the components package, hopefully. And they works be confused what the difference between the two is (since it's an Implementation detail).
Also: what if you don't know if the "outer" stuff uses marigold!?
waiting for #1317
Description
The
<MarigoldProvider>
always adds react-aria's OverlayProvider. Especially if you using cascading theming. There should only be a single instance of the provider at any time.Otherwise this can lead to inaccessible overlays.