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

Allow for zero code change setup (via default context provider values) #364

Open
chrisirhc opened this issue May 18, 2020 · 0 comments
Open

Comments

@chrisirhc
Copy link

chrisirhc commented May 18, 2020

The React.createContext API allows for a default value to be provided.
Couldn't we use that so that StyletronProvider wrapping is optional?

This saves every consumer from adding that additional wrapper unless they want to customize the behavior.

styled-components seems to support this out of the box, but styletron goes to a noop mode.

I saw this while doing a comparison in for chrisirhc/react-vis#2 / chrisirhc/react-vis#1 .

For reference the other differences found were syntactical so the big factor is really setup: https://github.com/chrisirhc/react-vis/compare/styledcomponents..styletron

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

1 participant