Skip to content

Instantly share code, notes, and snippets.

@hardfire
Created August 18, 2022 07:36
Show Gist options
  • Save hardfire/ad18143d15aca337886e4d73e6f89f14 to your computer and use it in GitHub Desktop.
Save hardfire/ad18143d15aca337886e4d73e6f89f14 to your computer and use it in GitHub Desktop.
//@ts-nocheck
import Constants, {AppOwnership} from 'expo-constants';
import {Image} from 'react-native';
let ImageElement = Image;
function init() {
// https://docs.expo.dev/versions/latest/sdk/constants/
// AppOwnership.Expo - The experience is running inside of the Expo Go app.
if (Constants.appOwnership !== AppOwnership.Expo) {
import('react-native-fast-image').then((FastImage) => {
ImageElement = FastImage;
});
}
}
init();
export default ImageElement;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment