custom props on component styled components typescript code example
Example 1: styled components props typescript
# to prevent typescript error, install this
yarn add @types/styled-components
# NPM
npm install @types/styled-components
Example 2: styled components attrs
export const TextInputElement = styled.TextInput.attrs(props => ({
placeholderTextColor: props.ColorPlaceholder,
}))`
font-size: 15px;
line-height: 18px;
color: '#000';
`;