MCPcopy Create free account
hub / github.com/expo/examples / AnimatedAppLoader

Function AnimatedAppLoader

with-splash-screen/App.js:28–45  ·  view source on GitHub ↗
({ children, image })

Source from the content-addressed store, hash-verified

26}
27
28function AnimatedAppLoader({ children, image }) {
29 const [isSplashReady, setSplashReady] = useState(false);
30
31 useEffect(() => {
32 async function prepare() {
33 await Asset.fromURI(image.uri).downloadAsync();
34 setSplashReady(true);
35 }
36
37 prepare();
38 }, [image]);
39
40 if (!isSplashReady) {
41 return null;
42 }
43
44 return <AnimatedSplashScreen image={image}>{children}</AnimatedSplashScreen>;
45}
46
47function AnimatedSplashScreen({ children, image }) {
48 const animation = useMemo(() => new Animated.Value(1), []);

Callers

nothing calls this directly

Calls 1

prepareFunction · 0.85

Tested by

no test coverage detected