setRunicInstance function

Module @runic-artifex/svelte in @runic-artifex/svelte 0.23.0

function setRunicInstance(instance: RunicInstance): RunicInstance;

Makes instance the Runic instance of the calling component and its children: useView, useField, useText, useBridgeConnection, useAppearance, ViewOutlet and the other helpers below it connect and read through it instead of the page instance. Call it during component initialization, before those helpers. A guest that renders inside another page, such as an embedded component, calls it in its root component.

<script lang="ts">
  let { bridge } = $props();
  const instance = setRunicInstance(createRunicInstance({ bridge }));
  onDestroy(() => instance.dispose());
</script>