Skip to content

DominicTylor/use-window-resize-handler

Repository files navigation

codecov.io

use-window-resize-handler

example:

const resizeHandler = (a, b, c) => {
    /* some magic here */
}

useWindowResizeHandler(resizeHandler, argsA, argsB, argsC)

Hook will add only one listener per resize for all uses in components. The handler will be called in the useEffect when the hook is first called, later it will be called after the resize with debounce. You can pass arguments after the handler, separated by commas, they are all passed to the handler when called.

About

React hook for resize handler

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published