MCPcopy Index your code
hub / github.com/callstack/react-native-paper / restoreState

Function restoreState

example/src/index.tsx:60–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58
59 React.useEffect(() => {
60 const restoreState = async () => {
61 try {
62 const savedStateString = await AsyncStorage.getItem(PERSISTENCE_KEY);
63 const state = JSON.parse(savedStateString || '');
64
65 setInitialState(state);
66 } catch (e) {
67 // ignore error
68 } finally {
69 setIsReady(true);
70 }
71 };
72
73 if (!isReady) {
74 restoreState();

Callers 1

PaperExampleFunction · 0.70

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…