styled components css helper to cssobject code example
Example 1: styled components props typescript
interface YourProps {
invalid: boolean
}
const Input = styled.input`
border: ${(p: YourProps) => p.invalid ? 'red' : 'blue'};
`
Example 2: styled components attrs
export const TextInputElement = styled.TextInput.attrs(props => ({
placeholderTextColor: props.ColorPlaceholder,
}))`
font-size: 15px;
line-height: 18px;
color: '#000';
`;