Skip to content

Instantly share code, notes, and snippets.

@callstack-bot
Last active September 21, 2022 14:59
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/25df7f90ea4f7d7083487128c94450ba to your computer and use it in GitHub Desktop.
Save callstack-bot/25df7f90ea4f7d7083487128c94450ba to your computer and use it in GitHub Desktop.
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