Created
April 12, 2023 09:20
-
-
Save pytqqq/f34b963ff52e98f8c7ed76a5b8d2d001 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
import React from "react"; | |
import { Federated } from "@callstack/repack/client"; | |
import { ActivityIndicator, StyleSheet, View } from "react-native"; | |
const MiniAppNavigator = React.lazy(() => | |
Federated.importModule("MiniApp", "./MiniAppNavigator") | |
); | |
const FallbackComponent = () => ( | |
<View style={styles.container}> | |
<ActivityIndicator size="large" /> | |
</View> | |
); | |
const MiniAppScreen = () => { | |
return ( | |
<React.Suspense fallback={<FallbackComponent />}> | |
<MiniAppNavigator /> | |
</React.Suspense> | |
); | |
}; | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: "center", | |
alignItems: "center", | |
}, | |
}); | |
export default MiniAppScreen; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment