Skip to content

JsonValue

Create a JSON value from a JS value. When the provided JS value is an object, the JsonObject component will be used. When the provided JS value is an array, the JsonArray component will be used. Otherwise, the JS value will be serialized to a string, number, boolean, or null as appropriate.

import { JsonValue } from "@alloy-js/json";
<JsonValue jsValue={unknown} refkey={Refkey | Refkey[]} />

Props

jsValueunknown

The JS value to serialize to JSON. When provided, thi

refkeyoptionalRefkey | Refkey[]

The refkey or array of refkeys for the JSON value. When provided, this value can be referenced elsewhere via this refkey.