Skip to content

Instantly share code, notes, and snippets.

@BrooklinJazz
Last active November 21, 2018 13:34
Show Gist options
  • Select an option

  • Save BrooklinJazz/7a0849623b33e9fbb08c047daf41fc60 to your computer and use it in GitHub Desktop.

Select an option

Save BrooklinJazz/7a0849623b33e9fbb08c047daf41fc60 to your computer and use it in GitHub Desktop.
React-Hook Counter
import React, { useState, Fragment } from "react"
export default function Counter(params) {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click Me
</button>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment