1. @threlte/core
  2. ContextBridge

@threlte/core

ContextBridge

This component is used to consume the context and rootContext provided by the <Canvas> component outside of it.

Import

Source

Github View Source Code

Package

NPM View Package

Example

<script>
  import { Canvas, ContextBridge } from '@threlte/core'

  let ctx
  $: console.log(ctx)
</script>

<Canvas>
  <ContextBridge bind:ctx />
</Canvas>

Bindings

ctx: ThrelteContext
rootCtx: ThrelteRootContext