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

Use React's Context API to automatically set variant for certain components #52

Open
tarikhamilton opened this issue Apr 9, 2019 · 0 comments
Labels
component Component work enhancement New feature or request

Comments

@tarikhamilton
Copy link
Contributor

tarikhamilton commented Apr 9, 2019

Docs: https://reactjs.org/docs/context.html
Cool tutorial: https://www.youtube.com/watch?v=XLJN4JfniH4

Basically,

we should be able to create a system where certain components expecting children, for example <WizardModal.Body />, create a context. <TextField /> can check for a context and thus derive the variant.

This is an idea. I don't have time to dive deeper, but this will help enforce some style rules when making new components through composition.

@tarikhamilton tarikhamilton added component Component work enhancement New feature or request labels Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component Component work enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant