Render a complete snapshot <script> tag with the value serialized safely.
The tag uses type="application/json" so the browser never executes it; the client
reads element.textContent and parses it. The id is escaped defensively even though
it is normally a constant.
Parameters
value: unknown
The snapshot value (already a JSON string, or any serializable value).
Render a complete snapshot
<script>tag with the value serialized safely.The tag uses
type="application/json"so the browser never executes it; the client readselement.textContentand parses it. Theidis escaped defensively even though it is normally a constant.