@replyke/ui-core-react-native
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
25 lines • 852 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getImageComponent = void 0;
/**
* Dynamically loads the Image component.
* Tries to require expo-image's Image, and if not found, falls back to React Native's Image.
*
* @returns {Object} An object containing the ImageComponent and a flag indicating if it's expo-image.
*/
const getImageComponent = () => {
let ImageComponent;
let isExpo = false;
try {
// Try to load expo-image's Image component.
ImageComponent = require("expo-image").Image;
isExpo = true;
}
catch (error) {
// Fallback to React Native's Image.
ImageComponent = require("react-native").Image;
}
return { ImageComponent, isExpo };
};
exports.getImageComponent = getImageComponent;
//# sourceMappingURL=getImageComponent.js.map
;