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

Function savePrefs

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

Source from the content-addressed store, hash-verified

114
115 React.useEffect(() => {
116 const savePrefs = async () => {
117 try {
118 await AsyncStorage.setItem(
119 PREFERENCES_KEY,
120 JSON.stringify({
121 theme: isDarkMode ? 'dark' : 'light',
122 rtl,
123 })
124 );
125 } catch (e) {
126 // ignore error
127 }
128
129 if (I18nManager.getConstants().isRTL !== rtl) {
130 I18nManager.forceRTL(rtl);
131 Updates.reloadAsync();
132 }
133 };
134
135 savePrefs();
136 }, [rtl, 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…