The React snippet collection contains function components and reusable hooks for React 16.
Runs an animating function, calling it before every repaint.
React, Hooks · Dec 29, 2021
When developing React components, you might often need to conditionally apply a className. Learn how to handle empty classNames correctly using this handy tip.
React, Components · Nov 7, 2021
Executes a callback immediately after a component is updated.
React, Hooks · Nov 9, 2021
Creates a stateful value that is persisted to localStorage
, and a function to update it.
React, Hooks · Sep 13, 2021
Creates a stateful value that is persisted to sessionStorage
, and a function to update it.
React, Hooks · Sep 15, 2021
Learn of all the different ways to set the value of a selected input in React with this quick guide.
React, Components · Jun 12, 2021
Renders a string as plaintext, with URLs converted to appropriate link elements.
React, Components · Nov 3, 2020
Handles the event of clicking inside the wrapped component.
React, Hooks · Nov 16, 2020
Handles the event of clicking outside of the wrapped component.
React, Hooks · Nov 16, 2020
Creates a stateful Map
object, and a set of functions to manipulate it.
React, Hooks · Nov 6, 2021
Creates a stateful value, and a function to update it by merging the new state provided.
React, Hooks · Sep 23, 2021