UseState Example 2

PHOTO EMBED

Tue Sep 06 2022 17:22:56 GMT+0000 (Coordinated Universal Time)

Saved by @bfpulliam #react.js

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
content_copyCOPY