import React, {useState} from 'react' function HookCounter() { const [count, setCount]= useState(0) return ( <div> <button onClick={() => setCount(count + 1)}>Count {count}</button> </div> ) } export default HookCounter
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter