mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-26 18:58:17 +00:00
Update handling-events.md (#8762)
* Update handling-events.md * Update handling-events.md
This commit is contained in:
committed by
Dan Abramov
parent
27acbb08f3
commit
45000cb3a7
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user