Answer the question
In order to leave comments, you need to log in
REACT how to simulate a click?
let element = document.getElementsByClassName('ant-select-selection__clear')
element.click();
//способ 1
document.querySelector("ant-select-selection__clear").click();
//способ 2
Answer the question
In order to leave comments, you need to log in
React has synthetic events
https://reactjs.org/docs/handling-events.html
Why simulate a click when you can immediately call the handler function?
If you need to reach a real element in the house, you need to create a link to it and knock on the link
https://reactjs.org/docs/refs-and-the-dom.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question