const Flex = styled(Stack, {
shouldForwardProp: (prop) => calcShouldForwardProp(prop),
})<LayoutProps>(({ center, autoWidth, autoFlex, theme }) => ({
}));
This syntax is a bit confusing to me. I understand the functionality of the code, but the structure perplexes me.
So we have a function styled(param1, param2)
. Got it.
But what comes next?
There's a type <type>
that represents the parameters expected by a function enclosed in ()
after it.
But how do you define a function after calling styled()
?
We end up with
styled()<some type>((params, of, that, type) => result)
.
Is there a specific rule or pattern for what follows the call to styled()
?