Live2D
摘要: hooks 的故事(1):闭包陷阱 经典的场景: function App(){ const [count, setCount] = useState(1); useEffect(()=>{ setInterval(()=>{ console.log(count) }, 1000) }, []) } 阅读全文
posted @ 2020-09-04 19:50 二胖he鼠标 阅读(1405) 评论(0) 推荐(0) 编辑
摘要: 对于react hooks刚开始使用的开发者,为了保证不误用,官方建议装上eslint-plugin-react-hooks 先 npm install eslint-plugin-react-hooks 在.eslintrc.js文件里添加: { "plugins": [ "react-hooks 阅读全文
posted @ 2020-09-04 19:41 二胖he鼠标 阅读(147) 评论(0) 推荐(0) 编辑