ReactJs detects all events associated with an item

I'm trying to find out what gets fired when I click on an element on a website that was created using responseJS, I click on the element and the event fires, but when I try el.click()nothing happens, the event is firing if it was either right or left a click of the mouse, I don’t know what primarily reacts to JJ, but I read that actionJS has its own “synthetic events”, which are supposed to carry their own events! therefore, I assume that I el.click()should fire this synthetic event no matter what it is. But this is not so.

I created an event that writes a line to the console to check if it will be executed when I click on an element, but it is not! Instead, the source event of the application was fired.

So I thought, maybe if I can list all the “synthetic events" for this element, I could fire it with el.dispatchEvent(event)?

Hope I make sense, thanks!

+4
source share
1 answer

el.dispatchEvent(event)must send the event correctly. Although I think that the "native" event listeners will not be triggered by this. Only react to internal ones. Synthetic events will not flow outside.

document.body. , , event.target ( ).

0

Source: https://habr.com/ru/post/1656242/


All Articles