wcandillon / react-native-img-cache

Image Cache for React Native
https://hackernoon.com/image-caching-in-react-native-96d8df33ca84
Apache License 2.0
732 stars 142 forks source link

ReactNative ImageBackground #71

Closed shahankit closed 6 years ago

shahankit commented 7 years ago

As of ReactNative 0.46 using, it's recommended to use ImageBackground component whenever Image has children. This is possible using CustomImageCache component as follow:

<CustomCachedImage
    component={ImageBackground}
    source={{ uri: 'http://loremflickr.com/640/480/dog' }} 
/>

Although if there is a directly available component name CachedImageBackground to import then it would be great.

wcandillon commented 7 years ago

I didn't know about ImageBackground, indeed this would be a good idea.

wcandillon commented 7 years ago

@shahankit Can you point me to the documentation of ImageBackground ?

shahankit commented 7 years ago

I get a console warning whenever using <Image /> with children to use <ImageBackground /> instead. I found this in documentation for ImageBackground: http://facebook.github.io/react-native/releases/0.48/docs/images.html#background-image-via-nesting

wcandillon commented 7 years ago

Thks a lot 👍🏻

gameboyVito commented 7 years ago

Same issue. Please fix it, thanks.

brianhiss commented 7 years ago

@wcandillon I'm getting a depreciated message in react-native 0.49.2.

Using <Image> with children is deprecated and will be an error in the near future.

Looks like their going to depreciate in the next release or two.

jayshah123 commented 6 years ago

looks like you have landed a fix in master, If it is usable, would you be willing to cut a release?

wcandillon commented 6 years ago

@jayshah123 Thank you for pointing that out, will make a release now.