Skip to content

Scope

Declare a scope for this component’s children. Any symbols and scopes declared in the children of this component will be in this scope.

Declare a scope by providing an already created scope. The scope is merely exposed via Scope context.

import { Scope } from "@alloy-js/core";
<Scope value={OutputScope}>
{children}
</Scope>
childrenoptionalChildren
valueScope context interface

The scope to use. If not provided, a new scope will be created.

Create a scope by providing a name and optional metadata.

import { Scope } from "@alloy-js/core";
<Scope
metadata={Record<string, unknown>}
name="string"
ownerSymbol={OutputSymbol}
>
{children}
</Scope>
childrenoptionalChildren
metadataoptionalRecord<string, unknown>

Additional metadata for the scope.

nameoptionalstring

The name of this scope.

ownerSymboloptionalMemberDeclaration context interface

Create a member scope with the owner symbol providing the in-scope symbols.