-
I have some compound type variations that are not compatible. type HorizontalMenuVariants = {
variant: 'tabs' | 'pills';
tone: 'primary' | 'secondary';
justified: boolean;
};
type VerticalMenuVariants = {
variant: 'static' | 'collapse' | 'pop-out';
tone: 'light' | 'dark';
};
type MenuVariants = HorizontalMenuVariants | VerticalMenuVariants; Is there a way to describe it with recipe? |
Beta Was this translation helpful? Give feedback.
Answered by
askoufis
Sep 16, 2023
Replies: 1 comment
-
I don't think there's a way to do it with a single recipe. IMO a single recipe and a single component go well together, so the fact that you've had to create two separate recipes could be a signal that really you should be creating two components here, a |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
shulcsm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think there's a way to do it with a single recipe. IMO a single recipe and a single component go well together, so the fact that you've had to create two separate recipes could be a signal that really you should be creating two components here, a
VerticalMenu
and aHorizontalMenu
, rather than toggling between recipes at runtime based on props.