useAuthState
useAuthState
is a basic hook that persists tokens securely on native with expo-secure-store
and in local storage on web.
API
import { useAuthState } from "@flexnative/authentication";
Component
Custom hook to manage authentication state.
useAuthState
Type: useAuthState(key: string): UseStateHook<string>
Props
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
key | string | true | undefined | The key of the authentication state item. |
Output
Type definition for the useState hook.
Type | Description |
---|---|
UseStateHook<T> | Type definition for the useState hook. T - The type of the state value. |