import { View } from 'expo-dev-client-components'; import * as React from 'react'; import { loadFontsAsync } from '../native-modules/DevMenu'; import { Splash } from './Splash'; type LoadInitialDataProps = { children: React.ReactElement[]; loader?: React.ReactElement; }; export function LoadInitialData({ children, loader = }: LoadInitialDataProps) { const [isLoading, setIsLoading] = React.useState(true); React.useEffect(() => { loadFontsAsync().then(() => { setIsLoading(false); }); }, []); if (isLoading) { return loader; } return {children}; }