Answers for "styled components nested components"

1

styled components nested components

import React from "react"
import styled from 'styled-components'

const Button = (props) => (
  <button className={props.className}></button>
)

const StyledButton = styled(Button)``

const HeaderWrapper = styled.div`
  font-size: xx-large;
  font-weight:bold;
  color: brown;

  ${StyledButton}{
    height:100px;
    background-color: blue;
  }
`

const Header = () => (
  <HeaderWrapper>
    <StyledButton></StyledButton>
	Lorem Ipsum
  </HeaderWrapper>
)

export default Header
Posted by: Guest on May-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language