cockpit-plugin-base-react - v1.1.1
    Preparing search index...

    Function useLocalStorage

    • Typed localStorage hook with optional cross-tab synchronisation.

      Type Parameters

      • T

      Parameters

      • key: string

        localStorage key.

      • defaultValue: T

        Value used when the key is absent or unreadable.

      • options: LocalStorageOptions<T> = {}

        Optional serialization and cross-tab sync config.

      Returns [T, (value: T | ((prev: T) => T)) => void, () => void]

      [value, setValue, remove]