title: How to create a link element dynamically and simulate click event react
body: <p>I am trying implement a function that takes url and navigates to the provided URL, from typescript function I am trying create a link object dynamically and simulate click event on  the dynamic link? I have following code to create the link element not sure hot simulate the click</p>
  <pre><code>const openExternalLink = (linkAddress) =&gt; {
      const linkElement = React.createElement('a', {href: linkAddress},linkAddress);
  
      linkElement.click(); &lt;-- ERROR
  };
  </code></pre>
  <p>The above code not compiling following is the error message:</p>
  <pre><code>Property 'click' does not exist on type 'DetailedReactHTMLElement&lt;{ href: string; }, HTMLElement&gt;'.ts(2339)
  </code></pre>
  <p>Any idea how to simulate the click on a dynamically created UI element?</p>