UNPKG

expo-app-loading

Version:

A React component that keeps the native splash screen visible.

28 lines 734 B
import * as SplashScreen from 'expo-splash-screen'; import React from 'react'; export default class AppLoading extends React.Component { static defaultProps = { autoHideSplash: true, }; constructor(props) { super(props); SplashScreen.preventAutoHideAsync(); } componentWillUnmount() { if (this.props.autoHideSplash === false) { return; } // @ts-ignore if (global.__E2E__) { // Hide immediately in E2E tests SplashScreen.hideAsync(); } else { setTimeout(SplashScreen.hideAsync, 200); } } render() { return null; } } //# sourceMappingURL=AppLoadingNativeWrapper.js.map