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

Function restoreState

example/src/index.native.tsx:76–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74
75 React.useEffect(() => {
76 const restoreState = async () => {
77 try {
78 const savedStateString = await AsyncStorage.getItem(PERSISTENCE_KEY);
79 const state = JSON.parse(savedStateString || '');
80
81 setInitialState(state);
82 } catch (e) {
83 // ignore error
84 } finally {
85 setIsReady(true);
86 }
87 };
88
89 if (!isReady) {
90 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…