antonioru / beautiful-react-hooks

🔥 A collection of beautiful and (hopefully) useful React hooks to speed-up your components and hooks development 🔥
https://antonioru.github.io/beautiful-react-hooks/
MIT License
8.17k stars 577 forks source link

refactor: optimize useEvent logic #387

Closed liucan233 closed 2 years ago

liucan233 commented 2 years ago

Description

  1. modify error message;
  2. ensure that "current" in this scope does not change with ref.

Related Issue

none

Motivation and Context

ensure that "current" in this scope does not change with ref.

How Has This Been Tested?

Link to another project and run this hook.

Screenshots (if appropriate):

none