Closed ustuncem closed 6 months ago
Based on this issue there is a typescript problem that throws an error on trying to create a variant. In the issue there was a fix indicating that if we specify the name of the key like:
const variant = createVariant<Theme, 'buttonVariants'>({ themeKey: 'buttonVariants', defaults: { margin: 'm', }, })
the ts error goes away. I updated the docs because this caused me a 1 day delay to search and fix.
Addressed in https://github.com/Shopify/restyle/pull/292
Description
Based on this issue there is a typescript problem that throws an error on trying to create a variant. In the issue there was a fix indicating that if we specify the name of the key like:
const variant = createVariant<Theme, 'buttonVariants'>({ themeKey: 'buttonVariants', defaults: { margin: 'm', }, })
the ts error goes away. I updated the docs because this caused me a 1 day delay to search and fix.