Skip to content

Intermact API Reference / @intermact/react / useIntermactPlayer

Function: useIntermactPlayer()

useIntermactPlayer(program, options?): BuiltProgram | null

Defined in: react/src/hooks/useIntermactPlayer.ts:37

Run a program's build pass and return the resulting BuiltProgram (player + scene + viewports), or null while the async build is in flight. Disposes the previous built program when program changes or on unmount.

React StrictMode runs effects twice in dev; we avoid clearing built or disposing the player on the first effect's cleanup so slow builds (LaTeX, fonts) are not stuck on "Building…".

Parameters

program

IntermactProgram

options?

UseIntermactPlayerOptions

Returns

BuiltProgram | null

Intermact v1.0 — 文档覆盖 Phase-1 / Phase-2 / Phase-3(全阶段)