Skip to content

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>

Props

childrenChildren
namestring

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" />

Props

jsValueunknown
namestring

See also