Skip to content

Define browser measurement hook return shapes #529

Closed

Description

@mnxmnz

useKeyboardHeight and useVisualViewport wrap their measurements, while useNetworkStatus and useScrollDirection return values directly. Define a consistent return shape for scalar and composite measurements; update affected types, docs, and SSR tests.

Activity

  1. self-assigned this
    on Sep 28, 2026
  2. added theissue type on Sep 28, 2026
  3. hyesungoh commented on Sep 28, 2026

    @hyesungoh
    Member

    @mnxmnz One more candidate for this issue. subscribeKeyboardHeight returns { unsubscribe }, an object that holds a single function. Since #531 unwraps single values in the browser hooks, returning the unsubscribe function directly (const unsubscribe = subscribeKeyboardHeight(...)) would follow the same direction. On the other hand, an object is easier to extend if the subscription ever needs another field.

    Could you decide whether it fits in this issue? useKeyboardHeight is the only internal caller.

  4. mnxmnz commented on Oct 6, 2026

    @mnxmnz
    MemberAuthor

    @hyesungoh Since #531 is closed and we're keeping the object shapes, I think subscribeKeyboardHeight should keep returning { unsubscribe } too 🙂 It lines up with the browser hooks and leaves room if the subscription ever needs another field. Closing this as decided in #531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions