Skip to content

Add usePageVisibilityEffect and deprecate useVisibilityEvent #541

Closed

Description

@hyesungoh

useVisibilityEvent runs a callback when the value of usePageVisibility would change, but the names do not show that the two are a pair. It is also the only hook with an *Event suffix, while useOutsideClickEffect uses *Effect for the same shape.

Add usePageVisibilityEffect with the same signature and behavior, mark useVisibilityEvent as deprecated with a pointer to the new name, and switch internal usages such as useImpressionRef to the new hook. Update docs and tests.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions