老师,您好,看官方文档时候,有一段,没看懂,您能帮忙给举个例子么,谢谢
https://facebook.github.io/react/docs/handling-events.html
Handling Events部分的末尾,有这样一段
The problem with this syntax is that a different callback is created each time the LoggingButton renders. In most cases, this is fine. However, if this callback is passed as a prop to lower components, those components might do an extra re-rendering. We generally recommend binding in the constructor or using the property initializer syntax, to avoid this sort of performance problem.
我想不到一个合适的例子来验证这句话,麻烦老师了,谢谢
轻松入门 React 开发,React Router 4 与 Webpack 2 完美升级项目
了解课程