@dxos/react-ui
    Preparing search index...

    Variable useControllableStateConst

    useControllableState: <T>(
        { prop, defaultProp, onChange, }: UseControllableStateParams<T>,
    ) => readonly [T | undefined, Dispatch<SetStateAction<T | undefined>>]

    State that is controlled when prop is supplied and uncontrolled (seeded from defaultProp) otherwise. onChange fires for every change in either mode; in controlled mode the setter only reports, it never stores.

    Type declaration

      • <T>(
            { prop, defaultProp, onChange, }: UseControllableStateParams<T>,
        ): readonly [T | undefined, Dispatch<SetStateAction<T | undefined>>]
      • Type Parameters

        • T

        Parameters

        Returns readonly [T | undefined, Dispatch<SetStateAction<T | undefined>>]