Self reference
#745
-
I'm wondering how would I reference the component itself, eg for styling identical siblings: const Component = styled(RadioGroupPrimitive.Item, {
bc: '$blackA9',
[`&:hover, &:hover + ${Component}`]: {
bc: '$warning10',
transform: 'scale(1.2)',
},
})
// throws 'Component' was used before it was defined |
Beta Was this translation helpful? Give feedback.
Answered by
peduarte
Aug 30, 2021
Replies: 1 comment
-
The const Component = styled(RadioGroupPrimitive.Item, {
bc: '$blackA9',
'&:hover, &:hover + &': {
bc: '$warning10',
transform: 'scale(1.2)',
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
buzinas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
&
basically references itself: