JsonObjectProperty
Create a JSON object property. A property can be created by providing a JS property value or children that defines the value.
Overload 1
Create a JSON object property with a name and children. The children become the value of the property.
import { JsonObjectProperty } from "@alloy-js/json";
<JsonObjectProperty name="string"> {children}</JsonObjectProperty>
import { JsonObjectProperty } from "@alloy-js/json/stc";
JsonObjectProperty({ name: string }).children(children)
Props
children | Children |
name | string |
Overload 2
Create a JSON object property with a name and a JS value. The JS value is serialized to JSON for the property
import { JsonObjectProperty } from "@alloy-js/json";
<JsonObjectProperty jsValue={unknown} name="string" />
import { JsonObjectProperty } from "@alloy-js/json/stc";
JsonObjectProperty({ jsValue: unknown, name: string }).children(children)
Props
jsValue | unknown |
name | string |