Skip to content

useEvent #26

Closed
Closed

Description

@Richienb
useEvent(target, name, () => {

}, deps)

Regular EventTargets don't expose generics to automatically get event data type, so we implement thin wrappers for document and window, who override it in custom ways:

useWindowEvent('resize', event => {

}, deps)
useDocumentEvent('keydown', event => {

}, deps)

Activity

  1. added a commit that references this issue on Feb 3, 2026
    dde1dbb
  2. sindresorhus commented on Feb 3, 2026

    @sindresorhus
    Owner
  3. added a commit that references this issue on Feb 5, 2026
    95cc33d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions