1// Tests nested Head metadata in a static rendering app. 2 3import * as Font from 'expo-font'; 4import { Stack } from 'expo-router'; 5import Head from 'expo-router/head'; 6 7export default function Layout() { 8 const [isLoaded] = Font.useFonts({ sweet: require('../sweet.ttf') }); 9 10 // This is important for the test because static font extraction will ensure this is never called 11 // with static websites. We can test by seeing if the app has HTML rendered. 12 if (!isLoaded) { 13 return null; 14 } 15 16 return ( 17 <> 18 <Head> 19 <meta name="expo-nested-layout" content="TEST_VALUE" /> 20 21 {/* Test that public env vars are exposed. */} 22 <meta name="expo-e2e-public-env-var-client" content={process.env.EXPO_PUBLIC_TEST_VALUE} /> 23 {/* Test that server env vars can be inlined during SSG. */} 24 <meta 25 name="expo-e2e-private-env-var-client" 26 content={process.env.EXPO_NOT_PUBLIC_TEST_VALUE} 27 /> 28 </Head> 29 <Stack /> 30 </> 31 ); 32} 33