add then to setState react hooks code example Example: usestate const [count, setCount] = useState(0);