react-native-website
react-native-website copied to clipboard
Does the overflow prop from Image Style Props only work on iOS?
Description
There is no documentation regarding overflow
prop from Image Style Props.
What is the problem?
I've tried to use overflow
prop to style the Image
component, but it is difficult to find any documentation on its use case:
- The default value in the documentation is wrong. It says it is visible, but we can see that it's actually hidden.
- We can see that this prop works on iOS, but does nothing on Android. Snack
Clearly, it works differently than View's overflow
, as Image
component has no children. We can find some explanation in this commit. It states that: "overflow: 'hidden' is needed for network images with cover mode.". I tested this use case above, and it seems to have no effect on Android. I haven't delved too deeply into the code base, but I can guess that it may be related to:
- different scaling/resizing method (either
resizeMethod
or Fresco internals), - lack of logic related to
overflow
inReactImageView.java
& friends (at least I couldn't find it).
How can we address it?
We could update the documentation with the explanation when and where this props work or someone with more knowledge on the subject could explain it.
Why is it important?
We should strive to have up-to-date documentation on platform compatibility.