Releases: nearform/react-browser-hooks
Update dependencies and fix bug with Media Controls hook
Updated all package dependencies and fixed related warnings/errors and failed tests. Also fixed a small bug in Media Controls hook related to muting and unmuting.
Add IE11 support to scroll hook
In order to better support IE11, the scroll hook now internally uses window.pageXOffset
instead of window.scrollX
and window.pageYOffset
instead of window.scrollY
.
Change npm package name
From @nearform/react-browser-hooks
to react-browser-hooks
. The old package has been deprecated.
Handle media element initial muted state
Fixes a bug that caused initial state to not reflect the media's muted attribute
Add click-outside hook
The Click Outside Hook attaches a listener which will callback the target component with the event object on any click which is not on the target component, or a child of the target component.
Server-side rendering safety & sensible defaults
Sensible defaults are provided to allow each hook to be safely used when rendering on the server.
useOnline api change
useOnline
will now directly return a status boolean instead of an object with a status property.
Old const { status } = useOnline()
New const online = useOnline()