airbnb / airbnb/react-with-styles

Contextualized theme ?

Open
#176 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.7k
Forks
101
PR merge metrics
No merged PRs in 30d

Description

While hacking into `react-with-styles` in order to integrate `react-dates` in an application that use a different style architecture ([gist](https://gist.github.com/Volune/4e21cd7e72804c3a3b22778af6bbb8cc)), 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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading how Theme and Interface are implemented as singletons in react-with-styles, then review the React Context alternative raised in the issue. Determine whether separate component subtrees can use different themes and interfaces, and document the recommended approach or the design needed to support that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.