MCPcopy Create free account
hub / github.com/expo/examples / App

Function App

with-tinybase/App.js:101–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99
100// The main app.
101const App = () => {
102 // Initialize the (memoized) TinyBase store and persist it.
103 const store = useCreateStore(createStore);
104 useAndStartPersister(store);
105
106 return (
107 // Wrap the app in TinyBase context, so the store is default throughout and
108 // a SafeAreaProvider/SafeAreaView so it fits the screen.
109 <Provider store={store}>
110 <SafeAreaProvider>
111 <SafeAreaView style={styles.container}>
112 <Text style={styles.heading}>TinyBase Example</Text>
113 <NewTodo />
114 <Todos />
115 <ClearTodos />
116 </SafeAreaView>
117 </SafeAreaProvider>
118 </Provider>
119 );
120};
121
122const useAndStartPersister = (store) =>
123 // Persist store to Expo SQLite or local storage; load once, then auto-save.

Callers

nothing calls this directly

Calls 1

useAndStartPersisterFunction · 0.85

Tested by

no test coverage detected