Generates a unique id.

Parameters:
NameTypeDescription
prefixstring

Prefix to added to the generated unique id.

Since
  • 1.0.0
Returns:

Returns a unique Id, prepended with the speficied prefix.

Type: 
string
Example
import { uniqueId } from "@gravityforms/utils";

function Example() {
  const id = uniqueId( 'gform' );
}