Created
September 21, 2022 14:57
-
-
Save callstack-bot/538d0afc7e037e144a1693bed49a9ba7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line import/no-extraneous-dependencies | |
import { Federated } from '@callstack/repack/client'; | |
import React from 'react'; | |
import { Text, SafeAreaView } from 'react-native'; | |
const App1 = React.lazy(() => Federated.importModule('app1', './App')); | |
const App2 = React.lazy(() => Federated.importModule('app2', './App')); | |
export default function App() { | |
return ( | |
<SafeAreaView> | |
<Text>Host App</Text> | |
<React.Suspense fallback={<Text>Loading app1...</Text>}> | |
<App1 /> | |
</React.Suspense> | |
<React.Suspense fallback={<Text>Loading app2...</Text>}> | |
<App2 /> | |
</React.Suspense> | |
</SafeAreaView> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment