The React snippet collection contains function components and reusable hooks for React 16.
Renders a controlled <input>
element that uses a callback function to inform its parent about value updates.
React, Components · Nov 3, 2020
Renders an uncontrolled range input element that uses a callback function to pass its value to the parent component.
React, Components · Nov 25, 2020
Renders an uncontrolled <input>
element that uses a callback function to inform its parent about value updates.
React, Components · Nov 3, 2020
Renders a table with rows dynamically created from an array of primitives.
React, Components · Nov 3, 2020
Adds an event listener for the specified event type on the given element.
React, Hooks · Sep 1, 2021
Creates a stateful Set
object, and a set of functions to manipulate it.
React, Hooks · Nov 1, 2021
Observes visibility changes for a given element.
React, Hooks · Sep 10, 2021
Checks if the current environment matches a given media query and returns the appropriate value.
React, Hooks · Oct 13, 2021
When working with multiple useState
hooks in React, things can get a bit complicated while debugging. Luckily, there's an easy way to label these values.
React, Hooks · Nov 7, 2021
Testing React components that use portals can be difficult until you understand what you really need to be testing.
React, Testing · Mar 13, 2022