原文链接: react class 和hook混用
上一篇: regl-camera-ts 重构 regl的3d相机库
下一篇: 试试光追
详细参考这个
https://www.zoo.team/article/react-hooks-in-class-component
遇到这个错误
×
Error: Objects are not valid as a React child (found: object with keys {count}). If you meant to render a collection of children, use an array instead.
应该使用单花括号!!!!
我的场景比较简单, 长时间不写, 都不会写fc了...和vue混着来了
pnpx create-react-app react-ts --template typescript
基本思路就是透传属性, class中使用state, 然后fc中用属性, 这样能避免修改代码