Skip to content

Instantly share code, notes, and snippets.

@reime005
Last active January 23, 2021 00: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 reime005/3bb076567f9231cfdc5eda7327f01763 to your computer and use it in GitHub Desktop.
Save reime005/3bb076567f9231cfdc5eda7327f01763 to your computer and use it in GitHub Desktop.
// app.tsx
const App = () => {
const [store, setStore] = React.useState<null | Store>(null);
React.useEffect(() => {
setupStore().then(setStore);
}, []);
if (!store) {
return null; // or loading screen
}
return (
<RootStoreProvider value={store}>
<SafeAreaView style={{ flex: 1 }}>
<View>
<Example />
</View>
</SafeAreaView>
</RootStoreProvider>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment