Today I Learned

A Hashrocket project

Cache-control behavior for ReactNative's Image

React Native’s Image component accepts a cache property to override the caching behavior of images, but only on iOS. An interesting setting can force an image to only be loaded if it is in the cache.

<Image
  source={{
    uri: "https://facebook.github.io/react/logo-og.png",
    cache: "only-if-cached"
  }}
  style={{ width: 400, height: 400 }}
/>
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.