react-use
react-use copied to clipboard
Rename the "useEvent" hook to "useListener" to not clash with the soon-to-be build-in hook
Is your feature request related to a problem? Please describe.
This RFC describes a new React hook soon to be added in the core. No doubt it will happen, considering it is really needed and it is already showed in use as a preferred method to handle non-reactive event functions in React beta docs.
It would be better to rename this library's useEvent
hook to not clash with the soon-to-be build-in one.
But you may leave the old name as an alias for the backward-compatibility.
Describe the solution you'd like.
I suggest the new name to be useListener
. It's short, easy to understand, and IMO describes the functionality of the hook even more accurately. Also you may consider useEventListener
.