Skip to content

@ue-too/board-pixi-react-integration / index / usePixiCanvas

関数: usePixiCanvas()

usePixiCanvas<C>(): PixiCanvasContextType<C>

定義: board-pixi-react-integration/src/contexts/pixi/index.tsx:68

Access the PixiJS canvas context with typed components.

型パラメーター

C

C extends BaseAppComponents = BaseAppComponents

The component type to resolve. Defaults to ResolvedComponents which uses the global PixiCanvasRegistry augmentation if available, otherwise falls back to BaseAppComponents. For multi-page apps with different component types per page, pass the specific component type explicitly.

戻り値

PixiCanvasContextType<C>

The pixi canvas context with typed result and setResult

typescript
// Single-app project with module augmentation (no generic needed):
const { result } = usePixiCanvas();

// Multi-page project with explicit type:
const { result } = usePixiCanvas<TrainEditorComponents>();