Answers for "Destructuring props in styled-components"

0

Destructuring props in styled-components

const Post = styled.article`
  background: ${props =>
    props.isFeatured ? props.theme.yellow : props.theme.white
  };
`;

const Post = styled.article`
  background: ${({ isFeatured, theme }) =>
    isFeatured ? theme.yellow : theme.white
  };
`;
Posted by: Guest on February-03-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language