MCPcopy Create free account
hub / github.com/dabbott/react-native-express / loadName

Function loadName

examples/files/app/AsyncStorage.js:12–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 const [name, setName] = useState('World')
11
12 async function loadName() {
13 try {
14 const name = await AsyncStorage.getItem(STORAGE_KEY)
15
16 if (name === null) return
17
18 setName(name)
19 } catch (e) {
20 console.error('Failed to load name.')
21 }
22 }
23
24 async function saveName(name) {
25 try {

Callers 1

AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected