diff --git a/app/_layout.tsx b/app/_layout.tsx index 2e37cdd..63bf187 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -1,11 +1,18 @@ -import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'; -import { useFonts } from 'expo-font'; -import { Stack } from 'expo-router'; -import * as SplashScreen from 'expo-splash-screen'; -import { useEffect } from 'react'; -import 'react-native-reanimated'; +import { + DarkTheme, + DefaultTheme, + ThemeProvider, +} from "@react-navigation/native"; +import { useFonts } from "expo-font"; +import { Stack } from "expo-router"; +import * as SplashScreen from "expo-splash-screen"; +import { useEffect } from "react"; +import "react-native-reanimated"; +import { server } from "../mocks/server"; -import { useColorScheme } from '@/hooks/useColorScheme'; +import { useColorScheme } from "@/hooks/useColorScheme"; + +server.listen(); // Prevent the splash screen from auto-hiding before asset loading is complete. SplashScreen.preventAutoHideAsync(); @@ -13,7 +20,7 @@ SplashScreen.preventAutoHideAsync(); export default function RootLayout() { const colorScheme = useColorScheme(); const [loaded] = useFonts({ - SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'), + SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"), }); useEffect(() => { @@ -27,7 +34,7 @@ export default function RootLayout() { } return ( - + diff --git a/index.js b/index.js index cb2c5e9..c4de275 100644 --- a/index.js +++ b/index.js @@ -1,23 +1,3 @@ -import { registerRootComponent } from "expo"; -import { ExpoRoot } from "expo-router"; - -export const App = () => { - const ctx = require.context("./app"); - - return ; -}; - -async function enableMocking() { - if (!__DEV__) { - return; - } - - await import("./msw.polyfills"); - const { server } = await import("./mocks/server"); - - server.listen(); -} - -enableMocking().then(() => { - registerRootComponent(App); -}); +import "fast-text-encoding"; +import "react-native-url-polyfill/auto"; +import "expo-router/entry";