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

    Variable useStableConst

    useStable: <T>(value: T, equals: (a: NoInfer<T>, b: NoInfer<T>) => boolean) => T

    Holds the previous reference for as long as equals accepts the incoming value, so a value the caller assembles inline keeps one identity across the caller's renders.

    A render React discards can leave the ref holding the discarded value, which costs identity stability on the next render but never correctness.

    Type declaration

      • <T>(value: T, equals: (a: NoInfer<T>, b: NoInfer<T>) => boolean): T
      • Type Parameters

        • T

        Parameters

        • value: T
        • equals: (a: NoInfer<T>, b: NoInfer<T>) => boolean

        Returns T