Check out example codes for "styled components attrs". It will help you in understanding the concepts better.

Code Example 1

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

Learn ReactJs, React Native from akashmittal.com