Skip to content

Commit c32c788

Browse files
levizpao
authored andcommitted
Add explination of autoBind to DOM Event Listener tip
1 parent 4a0a14d commit c32c788

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/tips/11-dom-event-listeners.md

+2
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ React.renderComponent(<Box />, mountNode);
4242
```
4343

4444
`componentDidMount` is called after the component is mounted and has a DOM representation. This is often a place where you would attach generic DOM events.
45+
46+
Notice that the event callback is bound to the react component and not the original element. React automatically binds methods to the current component instance for you through a process of [autobinding](../docs/interactivity-and-dynamic-uis.html#under-the-hood-autobind-and-event-delegation).

0 commit comments

Comments
 (0)