←back to thread

218 points mdhb | 1 comments | | HN request time: 0.273s | source
Show context
ericyd ◴[] No.44392324[source]
> React doesn't provide a way to explicitly bind to properties and events of DOM elements, or provide directives that apply to an element.

I didn't understand this part, can anyone shed light? What is different between what's being described here and what React does with event listeners, etc?

replies(2): >>44392581 #>>44392634 #
1. krebby ◴[] No.44392581[source]
I think this is referring to the fact that React uses synthetic event listeners - it's cheaper to bind an event listener once at the root and do your own element matching than it is to continuously bind and unbind listeners.

https://react.dev/reference/react-dom/components/common#reac...