Skip to content

Instantly share code, notes, and snippets.

@callstack-bot
Created September 21, 2022 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callstack-bot/538d0afc7e037e144a1693bed49a9ba7 to your computer and use it in GitHub Desktop.
Save callstack-bot/538d0afc7e037e144a1693bed49a9ba7 to your computer and use it in GitHub Desktop.
// 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