Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/rn-tester/js/examples/Image/ImageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import RNTesterText from '../../components/RNTesterText';
import ImageCapInsetsExample from './ImageCapInsetsExample';
import React from 'react';
import {useEffect, useState} from 'react';
import {Image, ImageBackground, StyleSheet, Text, View} from 'react-native';
import {Image, ImageBackground, Platform, StyleSheet, Text, View} from 'react-native';

const IMAGE1 =
'https://www.facebook.com/assets/fb_lite_messaging/E2EE-settings@3x.png';
Expand Down Expand Up @@ -1040,7 +1040,13 @@ exports.examples = [
render: function (): React.Node {
return (
<Image
defaultSource={require('../../assets/bunny.png')}
defaultSource={Platform.select({
ios: require('../../assets/bunny.png'),
// Android note:
// In development mode, require()'d images are not bundled into APK,
// so we use a different image that is known to be bundled.
android: __DEV__ ? { uri: "legacy_image" } : require('../../assets/alpha-hotdog.png'),
})}
source={{
// Note: Use a large image and bust cache so we can in fact
// visualize the `defaultSource` image.
Expand All @@ -1050,7 +1056,6 @@ exports.examples = [
/>
);
},
platform: 'ios',
},
{
title: 'Cache Policy',
Expand Down
Loading