diff options
Diffstat (limited to 'src/utils/hooks.ts')
-rw-r--r-- | src/utils/hooks.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/hooks.ts b/src/utils/hooks.ts index 3914ef48..336ac26c 100644 --- a/src/utils/hooks.ts +++ b/src/utils/hooks.ts @@ -4,10 +4,10 @@ import {useEffect, useState} from 'react'; export const useAsyncStorage = (key: string, defaultValue: string) => { const [storedValue, setStoredValue] = useState<string>(defaultValue); - const getStoredItem = async (key: string, defaultValue: string) => { + const getStoredItem = async (currentKey: string, currentValue: string) => { try { - const item = await AsyncStorage.getItem(key); - const value = item ? item : defaultValue; + const item = await AsyncStorage.getItem(currentKey); + const value = item ? item : currentValue; setStoredValue(value); } catch (error) { console.log(error); |