Skip to content

borderColor transformation not compatible with Image style props #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pierpo opened this issue Jul 7, 2021 · 2 comments
Closed

borderColor transformation not compatible with Image style props #161

pierpo opened this issue Jul 7, 2021 · 2 comments

Comments

@pierpo
Copy link

pierpo commented Jul 7, 2021

Hi!

I used an Image component with a border color like this:

const CustomImage = styled.Image`
  border-color: #EDF1F7;
`;

But I face the following warning. Indeed, it looks like this package transforms borderColor to four properties borderTopColor etc.
Which does not work with the Image component style API https://reactnative.dev/docs/image-style-props#bordercolor

Any idea on how we could solve this?

 ERROR  Warning: Failed prop type: Invalid props.style key `borderTopColor` supplied to `Image`.
Bad object: {
  "borderTopWidth": 5,
  "borderRightWidth": 5,
  "borderBottomWidth": 5,
  "borderLeftWidth": 5,
  "borderTopColor": "#EDF1F7",
  "borderRightColor": "#EDF1F7",
  "borderBottomColor": "#EDF1F7",
  "borderLeftColor": "#EDF1F7",
  "width": 200,
  "height": 200,
  "borderTopLeftRadius": 200,
  "borderTopRightRadius": 200,
  "borderBottomRightRadius": 200,
  "borderBottomLeftRadius": 200
}
Valid keys: [
  "display",
  "width",
  "height",
  "start",
  "end",
  "top",
  "left",
  "right",
  "bottom",
  "minWidth",
  "maxWidth",
  "minHeight",
  "maxHeight",
  "margin",
  "marginVertical",
  "marginHorizontal",
  "marginTop",
  "marginBottom",
  "marginLeft",
  "marginRight",
  "marginStart",
  "marginEnd",
  "padding",
  "paddingVertical",
  "paddingHorizontal",
  "paddingTop",
  "paddingBottom",
  "paddingLeft",
  "paddingRight",
  "paddingStart",
  "paddingEnd",
  "borderWidth",
  "borderTopWidth",
  "borderStartWidth",
  "borderEndWidth",
  "borderRightWidth",
  "borderBottomWidth",
  "borderLeftWidth",
  "position",
  "flexDirection",
  "flexWrap",
  "justifyContent",
  "alignItems",
  "alignSelf",
  "alignContent",
  "overflow",
  "flex",
  "flexGrow",
  "flexShrink",
  "flexBasis",
  "aspectRatio",
  "zIndex",
  "direction",
  "shadowColor",
  "shadowOffset",
  "shadowOpacity",
  "shadowRadius",
  "transform",
  "transformMatrix",
  "decomposedMatrix",
  "scaleX",
  "scaleY",
  "rotation",
  "translateX",
  "translateY",
  "resizeMode",
  "backfaceVisibility",
  "backgroundColor",
  "borderColor",
  "borderRadius",
  "tintColor",
  "opacity",
  "overlayColor",
  "borderTopLeftRadius",
  "borderTopRightRadius",
  "borderBottomLeftRadius",
  "borderBottomRightRadius"
]
@jacobp100
Copy link
Contributor

Could you file this in styled-components?

@pierpo
Copy link
Author

pierpo commented Jul 7, 2021

Sorry, thought this would be the relevant repo. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants