VarDeclaration
Render a variable declaration
Props for VarDeclaration component
import { VarDeclaration } from "@alloy-js/csharp";
<VarDeclaration name="string" refkey={Refkey} type={Children}> {children}</VarDeclaration>
import { VarDeclaration } from "@alloy-js/csharp/stc";
VarDeclaration({ name: string, refkey: Refkey, type: Children,}).children(children)
children | optionalChildren Variable value |
name | string Variable name |
refkey | optionalRefkey Variable refkey |
type | optionalChildren Type of the variable declaration. If not specified, defaults to “var” |
Examples
Section titled “Examples”with var
<VarDeclaration name="myVar">42</VarDeclaration>
This will render:
var myVar = 42;
with type
<VarDeclaration name="myVar" type="int">42</VarDeclaration>
This will render:
int myVar = 42;