Extending styles with styled-components not working

后端 未结 2 1010
礼貌的吻别
礼貌的吻别 2021-02-19 10:59

I\'m trying to extend styles for a react component using styled-components but is not working. AFAIK, I\'m doing it the right way, but perhaps I\'m missing somethin

2条回答
  •  执念已碎
    2021-02-19 11:53

    I didn't know that was a way to do it. I would do:

        const Link = styled.a`
        ..put you css styles here (className styles)
       `
    
       const StyledLink = styled(Link) `
          color: palevioletred;
          font-weight: bold;
       `
    
    render(){
    return(
    
    Unstyled, boring Link
    Styled, exciting Link
    ) }

提交回复
热议问题