Answer the question
In order to leave comments, you need to log in
Styled-components and NOT className - what to do?
Hello everyone.
I have a React library component that accepts className and calendarClassName props, the latter will be used for some detail of this component.
styled-components makes it easy to spud className, but what about the calendar?
Answer the question
In order to leave comments, you need to log in
const BaseComponent = styled.div`
color: black;
`;
const Component = styled(({ className, ...props }) => <BaseComponent calendarClassName={className} {...props} />)`
color: white;
`;
BaseComponent
propagate to className
. Component
on calendarClassName
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question