React性能优化

87 阅读1分钟
  • 重写shouldComponentUpdate方法来避免re-render
  • 使用稳定(production)版本的React
  • 合理使用key,帮助React识别列表中所有子组件的最小变化
  • render中判断不渲染,尽量使用 return null。减少实际渲染出来的真实dom