poetries.github.io icon indicating copy to clipboard operation
poetries.github.io copied to clipboard

React设计模式和最佳实践总结 | Poetry's Blog

Open poetries opened this issue 4 years ago • 0 comments

http://blog.poetries.top/2019/08/10/react-good-practice/

一、组件实践1.1 设计原则 保持接口小,props 数量要少 根据数据边界来划分组件,充分利用组合 把 state 往上层组件提取,让下层组件只需要实现为纯函数 1.2 组件划分 任何一个复杂组件都是从简单组件开始的,一开始我们在 render 函数里写的代码不多,但是随着逻辑的复杂,JSX 代码越来越多,于是,就需要拆分函数中的内容 在 React 中,有一个误区,就是把 render

poetries avatar Aug 10 '19 14:08 poetries