小喆 Personal Blog

Back

useState 基础#

const [count, setCount] = useState(0);
jsx
  • useState 返回一个数组,第一个是值,第二个是更新函数
  • 更新函数会触发重新渲染
React 小笔记
https://xiaozheblog.vercel.app/blog/react-notes
Author 小喆
Published at 2026年6月12日