Answer the question
In order to leave comments, you need to log in
How to extend a component in styled-components?
There is a Link component, it is styled without styled-components. Is it possible to extend from Link in another component that will already be on styled-components?
Answer the question
In order to leave comments, you need to log in
It depends on how and what your Link component is styled with.
Let's say it's unstyled:
StyledComponents uses the className property for styling, since we use the rest operator, our component will implicitly pass any property to the a element , including the className passed by the library. So you can style like this:
const StyledLink = styled(Link)`
// some styles
`;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question