Feliz.UseListener
This library exposes React hooks for adding event listeners while ensuring that the lifecycle and dependcies are all correctly managed.
It has full typed access for all standard browser events. As well as a more generic React.useListener.on : string * #Event -> unit method for custom use-cases.
Has no bundle size increase.
Accessible via:
React.useListener
- documentReact.useElementListener
- specific element refReact.useWindowListener
- window
Typical Event Listeners
Inline element state styling
There is also a set of hooks to make applying styles for things such as when an element
is being hovered via the React.useStyle.on*
hooks.