Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 354 Bytes

File metadata and controls

20 lines (15 loc) · 354 Bytes

hooks-use-state-base

Hooks API Reference

useEffect

const App = () => {
  const [title, setTitle] = useState<string>('Initial Title')
  const handler = () => setTitle('Change Title')

  return (
    <>
      <h1>{title}</h1>
      <button onClick={handler}>click</button>
    </>
  )
}