The React snippet collection contains function components and reusable hooks for React 16.
React, Components
Renders a carousel component.
React, Hooks
Handles asynchronous calls.
React, Hooks
Implements fetch()
in a declarative manner.
React, Components
Renders an uncontrolled <select>
element that uses a callback function to pass its value to the parent component.
React, Hooks
Creates a stateful value, returning a getter and a setter function.
React, Hooks
Creates a portal, allowing rendering of children outside the parent component.
React, Hooks
Checks if the code is running on the browser or the server.
React, Hooks
Executes a callback whenever an event occurs on the global object.
React, Hooks
Avoid unnecessary re-runs by using primitive dependencies in your React effect.
React, Components
Renders a toggle component.
React, Hooks
Enables body scroll locking.
React, Hooks
Executes a callback whenever the window is scrolled.
React, Components
Renders a textarea component with a character limit.
React, Hooks
Checks if the client is online or offline.
React, Hooks
Executes a callback whenever the window is resized.