Opens a passed link in a new tab. Must be used inside a method triggered by user input to avoid popup blockers.

Parameters:
NameTypeDescription
urlstring

The url to open.

Since
  • 1.0.0
Returns:
Type: 
void
Example
import { openNewTab } from "@gravityforms/utils";

function Example() {
  const url = 'https://some-url.com/hello.jpg';
  openNewTab( url );
}