Skip to content

nested theme-ui providers #2550

Closed Answered by hasparus
RwwL asked this question in Q&A
May 6, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Yes, nesting providers is expected, but don't overdo it. Every context provider and consumer has some impact on perf.

You also may want to use the ThemeProvider from @theme-ui/core whenever you're nesting and want to only merge contexts without any of the other setup.

https://theme-ui.com/packages/core#theme-uicore

If this component is Button or similar often used part of the design system, I wouldn't wrap it. If it's something like BugReportForm or EmailComposer which's gonna be used once, wrapping it for convenient use in your other roots is definitely a valid move.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RwwL
Comment options

Answer selected by RwwL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants