Closed
Description
props => <div id={props.id} />
should be considered to a stateless component, props => props.borderRadius
should not
For example:
import styled from 'react-emotion'
const ButtonWrapperDiv = styled.div`
& .s-common-button {
border-radius: ${props => props.borderRadius}px;
background: ${props => props.backgroundColor};
color: ${props => props.textColor};
&:hover {
background: ${props => props.hoverBackgroundColor};
}
}
BTW, it's better to provide an option to allow one line stateless component to use props
directly.
For example:
const ComonentA = props => <div id={props.id} />
or
function ComonentA(props) { return <div id={props.id} /> }
Otherwise it will be too complicated:
const ComonentA = props => { const { id } = props; return <div id={id} /> }