I\'m trying to simulate a .click() event on a React element but I can\'t figure out why it is not working (It\'s not reacting when I\'m firing the
.click()
event
Use refs to get the element in the callback function and trigger a click using click() function.
refs
click()
class Example extends React.Component{ simulateClick(e) { e.click() } render(){ return console.log('clicked')}> hello } } ReactDOM.render(, document.getElementById('app'))