Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react clikc with ref

const myRef = useRef(null);

  const clickElement = (ref) => {
    ref.current.dispatchEvent(
      new MouseEvent('click', {
        view: window,
        bubbles: true,
        cancelable: true,
        buttons: 1,
      }),
    );
  };
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #clikc #ref
ADD COMMENT
Topic
Name
9+1 =