BoiAbsent
Results
2
comments of
BoiAbsent
箭头函数每次render都是新的,this.target一直都是同一个,箭头函数会造成不必要的diff
> > 箭头函数每次render都是新的,this.target一直都是同一个,箭头函数会造成不必要的diff > > react 并不会对属性进行 diff(除了 key 属性) > react 的 diff 策略是标签名字(组件名称)和 key > 所以并不会造成不必要的 diff 抱歉我描述得不对 是造成不必要的render,导致 PureComponent 或 shouldComponentUpdate() 的优化失效 可以参考[这里](https://zh-hans.reactjs.org/docs/faq-functions.html#arrow-function-in-render)