Skip to content

useResize

Uses ResizeObserver to watch app.container size changes and automatically sync renderer dimensions and camera aspect ratio.

Note: create3dApp's autoResize option enables this behavior by default. Use this function only when manual control is needed.

Usage

ts
import { create3dApp, useResize } from '@threeuse/core'

const app = create3dApp({ autoResize: false })
app.mount('#container')
useResize(app) // manually enable resize observation

Released under the MIT License.