styled components attrs
snippet in html

styled components attrs

user9936

export const TextInputElement = styled.TextInput.attrs(props => ({
  placeholderTextColor: props.ColorPlaceholder,
}))`
  font-size: 15px;
  line-height: 18px;
  color: '#000';
`;

styled components props typescript

user4661

interface YourProps {
  invalid: boolean
}

const Input = styled.input`
  border: ${(p: YourProps) => p.invalid ? 'red' : 'blue'};
`