Create text variant defaults is not working.
See original GitHub issueRestyle components do not use the default styles unless you specify itvariant="defaults"
in the props.
My component looks like:
import {
createRestyleComponent,
createText,
createVariant,
color,
spacing,
typography,
layout,
createBox,
} from '@shopify/restyle';
export const Link = createRestyleComponent(
[
color,
spacing,
typography,
layout,
createVariant({themeKey: 'linkVariants'}),
],
createText(),
);
The theme object variant looks like:
Video showing the variant only working when I set variant="defaults"
Version
More info:
I created a wraper component to inspect the style object passed down by the restyle wraper. As you can see the first two outputs are printed when variant is undefined
but the next two outputs shows are printed when variant="defaults"
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Variants in prototypes not sticking - Figma Community Forum
When I change between the two in editor, the date override sticks. But when I present, the hover variant, resets to the default...
Read more >Component Activation fails with: variant "default" is BROKEN
Hello All, I am trying to do a simlpe jsp change. After checking out, changing, and checking in the jsp I try to...
Read more >Configuring Variants - Tailwind CSS
When overriding the default variants, make sure you always specify all the ... at the end of your stylesheet by default to avoid...
Read more >Why are my interactive components with overrides displaying ...
... will not be displayed, and the default variant will appear instead, ... Our team has been continuously working to make our Figma ......
Read more >Figma Tutorial: Variants - YouTube
In this video we'll teach you how to create and use variants and component sets. Learn how to use interactive components here: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m having the same issue. running restyle 2.1.0. Going to try to downgrade to 2.0.0
This is still broken, and in addition, #35 is now appearing in new apps as well, and both are resolved by downgrading to 2.0.0. It’s a 50/50 of which of these issues appear in a new app I’m working on. At this point, I can only assume 2.1.0 is broken and has been for some time. Luckily 2.0.0 is fully stable, as I’m using this in 5 different apps and have been for a few months, so if anyone is using this library, make sure you
yarn add @shopify/restyle@2.0.0