A hook for data that should be saved to the session data.

  • Type Parameters

    • T

    Parameters

    • id: number

      The unique id of the view.

    • OptionaldefaultValue: T

      The default value or a callback to set default value.

    Returns {
        sessionData: T;
        sessionDataIsInitialized: boolean;
        setSessionData: Dispatch<SetStateAction<T>>;
    }

    An object with a flag indicating if the session data has been initialized, the current session data and a setter callback.