Created
April 14, 2023 08:35
-
-
Save pytqqq/43fea3fe330e9bc8e724bd235ee928bd 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 color="rgba(56, 30, 114, 1)" 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