Skip to content

Instantly share code, notes, and snippets.

Created February 5, 2020 22:20
What would you like to do?
React useReuse pattern
function Counter() {
// Some hooks the component needs
const [count, setCount] = useState(0);
// The rendering of the component
return (
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment