Can you reference one component within another in Styled-Components?

Asked

Viewed 10 times

0

There is the possibility of doing something of the kind in Styled-Components?

export const Componente1 = styled.div`
  background-color: #fff;
`;

export const Componente2 = styled.div`
  Componente1 {
    width: 100%;
  }
`;

I wanted to reference one component inside the other, is there any way to do that? I know it is possible to use classes, but it is good practice to use classes with Styled-Components?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.