Skip to content

namekey

Create a namekey with the given name. The namekey is a unique refkey that represents a single symbol with the given name and the provided naming-related options.

import { namekey } from "@alloy-js/core";
function namekey(name: string, options?: NamekeyOptions): Namekey;
name

string

optionsoptional

NamekeyOptions

ignoreNameConflictoptionalboolean
ignoreNamePolicyoptionalboolean
Namekey
const myClass = namekey("MyClass");
return <>
<ClassDeclaration name={myClass} />
{myClass}
</>

Renders a class and a reference to that class.