Since May 2018, we can write CSS objects in styled components.
Is it possible though to have conditionals in the objects (as we can with "normal" styled components). I cannot get the following conditional to work:
const StyledButton = styled.button({
backgroundColor: colors.defaultBlue,
borderRadius: '20px',
color: props => (props.hover === true ? '#fff' : '#000'),
border: 'none'
})
props => (this.props.hover ? '#fff' : '#000'). Or evaluate outside the object and pass the result in?propsand returnsstyled.button?