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

Overriding with "as" prop seems to not work correctly #650

Open
michalkvasnicak opened this issue Sep 22, 2020 · 0 comments
Open

Overriding with "as" prop seems to not work correctly #650

michalkvasnicak opened this issue Sep 22, 2020 · 0 comments
Labels
Milestone

Comments

@michalkvasnicak
Copy link
Member

We have following:

const Button = createComponent('button', {
   styles: {
     // some styles with variants
   },
   variants: [...]
});

const AddButton = createComponent(Button, {
   defaultProps: {
     type: 'button',
     variant: 'variant from Button'
   },
   styles: {
    fontSize: 0,
    lineHeight: 0,
    fontWeight: 'semiBold',
    mb: 2,
   },
});

then when we do:

<AddButton as="a">Add</AddButton>

it seems that styles from Button are not applied at all and variants are passed to a but aren't processed resulting to variant HTML attribute.

@michalkvasnicak michalkvasnicak added this to the v1.0.0 milestone Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant