Type hinting for default variants in composed component. #804
Answered
by
peduarte
VaibhavAcharya
asked this question in
Help
-
I have a export const TextPrimitive = css({
textRendering: "optimizeSpeed",
variants: {
font: {
heading: {
fontFamily: "$heading",
},
body: {
fontFamily: "$body",
},
code: {
fontFamily: "$code",
}
},
// more variants...
}
}); Now I create new text components by using this primitive & setting default variants for it. export const Paragraph = styled("p", TextPrimitive, {
defaultVariants: {
font: "body",
weight: "medium",
// etc...
}
}); This is indeed working as expected but I am not getting any type hinting in the Am I doing something wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
peduarte
Sep 20, 2021
Replies: 1 comment
-
Yes, we havent added that in. We ran into some TypeScript limitations there. The composition is quite deep, and TS doesn't know what to do. We will keep trying |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
VaibhavAcharya
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, we havent added that in.
We ran into some TypeScript limitations there. The composition is quite deep, and TS doesn't know what to do.
We will keep trying