Update handling-events.md (#8762)

* Update handling-events.md

* Update handling-events.md
This commit is contained in:
Snowmanzzz(Zhengzhong Zhao)
2017-01-12 22:30:43 +08:00
committed by Dan Abramov
parent 27acbb08f3
commit 45000cb3a7

View File

@@ -138,4 +138,4 @@ class LoggingButton extends React.Component {
}
```
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 to avoid this sort of performance problem.
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.