Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

conditionally changing styled components based on props

const Text = styled.p`
  color: ${(props) => (props.red ? 'red' : 'blue')};
`
Source by malcoded.com #
 
PREVIOUS NEXT
Tagged: #conditionally #changing #styled #components #based #props
ADD COMMENT
Topic
Name
1+8 =