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

Foundation: Extend Component #8331

Closed
JasonGore opened this issue Mar 14, 2019 · 2 comments
Closed

Foundation: Extend Component #8331

JasonGore opened this issue Mar 14, 2019 · 2 comments
Assignees

Comments

@JasonGore
Copy link
Member

JasonGore commented Mar 14, 2019

  • We should provide a method for easily extending and customizing existing components, such as tweaking styling. As a generic example:
    • const FancyStyledButton = extendComponent(Button, { tokens: { backgroundColor: fancyColor } });
    • Could make 'hidden' static on Button like __def that is accessible by extendComponent for calling createComponent to make a new component with extended options.
      • What would the arguments for extendComponent be? If constructed component, need to avoid wrapping component and adding layers to hierarchy.
  • Can there be a props transform supplied to createComponent, like:
    • (Component, props) => <Component horizontal horizontalAlign="end" gap={props.theme.buttonGap}>
    • Need to be careful that props precedence is intact, i.e. user props vs. theme props vs. HOC props
    • extendComponent / createComponent should be able to take in default props and props transforms
@khmakoto
Copy link
Member

khmakoto commented Feb 3, 2020

@JasonGore should we close this as well?

@JasonGore
Copy link
Member Author

Closing due to newer efforts that'll address this issue.

@microsoft microsoft locked as resolved and limited conversation to collaborators Mar 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants