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

Contextualized theme ? #176

Open
Volune opened this issue Sep 20, 2018 · 1 comment
Open

Contextualized theme ? #176

Volune opened this issue Sep 20, 2018 · 1 comment

Comments

@Volune
Copy link

Volune commented Sep 20, 2018

While hacking into react-with-styles in order to integrate react-dates in an application that use a different style architecture (gist), I realized that both the Theme and the Interface are singletons.

So if I understand well, it is not possible to have two customizations (use two different themes) for the same component in different places of the application.
Am I missing something? Wouldn't it be better to rely on React's Context (or another alternative)? What are the recommendations?

I'm asking by curiosity, I don't have an actual use case.

@ljharb
Copy link
Collaborator

ljharb commented Sep 20, 2018

I think the original hope/plan/thought was that you wouldnt ever want the same component to look inconsistent on the page when compared to another instance of itself.

Certainly if it was render-tree specific, it’d have to rely on React context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants