UNPKG

react-native-turbo-preferences

Version:

Modern TurboModule wrapper for iOS NSUserDefaults and Android SharedPreferences.

28 lines 729 B
/** * Simple React hook for managing a string preference * * @param key - The preference key * @returns [value, setValue, contains, clear] * * @example * ```tsx * function MyComponent() { * const [value, setValue, contains, clear] = usePreferenceString('username'); * * return ( * <View> * <Text>Username: {value || 'Not set'}</Text> * <Button title="Set to John" onPress={() => setValue('John')} /> * <Button title="Clear" onPress={clear} /> * </View> * ); * } * ``` */ export declare function usePreferenceString(key: string): [ string | null, (value: string) => Promise<void>, boolean, () => Promise<void> ]; //# sourceMappingURL=usePreferenceString.d.ts.map