React useBodyScrollLock hook
Enables body scroll locking.
The React snippet collection contains function components and reusable hooks for React 18.
Enables body scroll locking.
Handles asynchronous calls.
Creates a stateful Map
object, and a set of functions to manipulate it.
Tracks the browser's location search param.
Tracks the browser's location hash value, and allows changing it.
Handles the event of clicking inside the wrapped component.
Handles the event of clicking outside of the wrapped component.
Handles the event of hovering over the wrapped component.
Returns a stateful value, persisted in localStorage
, and a function to update it.
Implements fetch()
in a declarative manner.
Creates a stateful Set
object, and a set of functions to manipulate it.
Checks if the code is running on the browser or the server.
Delays creating a stateful value until some condition is met.
Watches for changes made to the DOM tree, using a MutationObserver
Dynamically loads an external script.
Listens for changes in the pressed state of a given key.
Runs an animating function, calling it before every repaint.
Executes a callback immediately after a component is updated.
Tracks the dimensions of the browser window.
Creates a stateful value, returning a getter and a setter function.
Wrapping your mind around React hooks and how they interact with setInterval()
can be difficult. Here's a guide to get you started.
Executes a callback whenever an event occurs on the global object.
Executes a callback whenever the window is scrolled.
Adds an event listener for the specified event type on the given element.