Opens a passed link in a new tab. Must be used inside a method triggered by user input to avoid popup blockers.
Parameters:
Name | Type | Description |
---|---|---|
url | string | The url to open. |
- Since
- 1.0.0
- Source
Returns:
- Type:
- void
Example
import { openNewTab } from "@gravityforms/utils";
function Example() {
const url = 'https://some-url.com/hello.jpg';
openNewTab( url );
}