Last active
September 21, 2022 14:59
-
-
Save callstack-bot/25df7f90ea4f7d7083487128c94450ba 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 * as React from 'react'; | |
import { Text } from 'react-native'; | |
// eslint-disable-next-line import/no-unresolved | |
import Module1 from 'module1/Root'; | |
import { foo } from './foo'; | |
export default function App() { | |
const [fooText, setFooText] = React.useState<string>(''); | |
React.useEffect(() => { | |
(async () => { | |
try { | |
const fooText = await foo(); | |
setFooText(fooText); | |
} catch { | |
setFooText('Failed to get foo text'); | |
} | |
})(); | |
}, []); | |
return ( | |
<> | |
<Text>App 1</Text> | |
<React.Suspense fallback={<Text>Loading module1...</Text>}> | |
<Module1 /> | |
</React.Suspense> | |
<Text>{fooText}</Text> | |
</> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment