Variant types from RecipeVariants doesn't work #1035
Answered
by
askoufis
gabrieloureiro
asked this question in
Q&A
-
I've this occurrence when i call this property inside the component. This is an issue? |
Beta Was this translation helpful? Give feedback.
Answered by
askoufis
Mar 9, 2023
Replies: 1 comment 2 replies
-
Your I think to fix this you'll want to extract the variants from the recipe type: type TextVariantSize = Required<NonNullable<RecipeVariants<typeof textStyles>>>['size']; Alternatively, you could construct your Atoms & { as?: AllowedHtmlTags } & RecipeVariants<typeof textStyles> |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
gabrieloureiro
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your
TextVariantSize
type isn't what you think it is. It's an object containing a propertysize
that can accept all your size variantsxxs
,xs
, etc., rather than just a union of all your size variants.I think to fix this you'll want to extract the variants from the recipe type:
Alternatively, you could construct your
TextProps
type in a different way: