Reputation: 1531
I am trying to access the '__reactEventHandlers' properties in JS. But I am not able to access the attribute in JS.But in developer console I can able see the attribute and i can able to access as well. Kindly help me on this.
Upvotes: 1
Views: 3018
Reputation: 1531
Using the below mentioned way we can able to access the _reactEventHandler object form the DOM Object.
var abc=document.querySelector('._2LpG3');
var reactHandlerKey=Object.keys(abc).filter(function(item){
return item.indexOf('__reactEventHandlers')>=0
});
var reactHandler=abc[reactHandlerKey[0]];
console.log(reactHandler) // React Event handler object and Properties
Thanks,
Hariharan S
Upvotes: 2