Radix themes with Astro #654
Replies: 5 comments
-
For future reference, it's how astro works. You cannot use react context within multiple astro islands.
|
Beta Was this translation helpful? Give feedback.
-
@thebrownfox are you saying features that rely on Theme context won't work in Astro? Not sure I'm seeing a workaround there |
Beta Was this translation helpful? Give feedback.
-
Yes. I can see there could be some workarounds.
|
Beta Was this translation helpful? Give feedback.
-
I see two things that need to happen for Themes to work with Astro:
In my opinion these are very reasonable things that should already be in Radix Themes. Contexts should've never been used across components; only a composition of a component makes sense to be using a context ( And mounting to closest theme Some people like to mount |
Beta Was this translation helpful? Give feedback.
-
Not really an issue on our part since Radix Themes relies on context by design, and that only works in a single React root. We have no plans to change our design at the moment, but I'll move this into discussion to keep the conversation open in the future. |
Beta Was this translation helpful? Give feedback.
-
With some components I get
useThemeContext must be used within a Theme
.Here's reproducible example: https://stackblitz.com/edit/github-uiu4in?file=src%2Fpages%2Findex.astro
Beta Was this translation helpful? Give feedback.
All reactions