loading

摘要: 下面是 Component 的接口,P 代表 Props、S 代表 State。 ```ts interface Component extends ComponentLifecycle { } ``` 所以,在 tsx 中写两个类型进行约束就可以了: ```tsx import { Compone 阅读全文
posted @ 2023-03-21 15:39 Himmelbleu 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 今天在学习 React 文档,列表渲染一节中提及到一个关于 key 绑定索引值(index)性能的问题: React 官方文档原文:“如果列表项目的顺序可能会变化,我们不建议使用索引来用作 key 值,因为这样做会导致性能变差,还可能引起组件状态的问题”。 查阅网上的博客,确实有对 Vue 列表渲染 阅读全文
posted @ 2023-03-21 14:38 Himmelbleu 阅读(58) 评论(0) 推荐(1) 编辑