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

Function savePrefs

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

Source from the content-addressed store, hash-verified

94
95 React.useEffect(() => {
96 const savePrefs = async () => {
97 try {
98 await AsyncStorage.setItem(
99 PREFERENCES_KEY,
100 JSON.stringify({
101 theme: isDarkMode ? 'dark' : 'light',
102 })
103 );
104 } catch (e) {
105 // ignore error
106 }
107 };
108
109 savePrefs();
110 }, [isDarkMode]);

Callers 1

PaperExampleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…