Usage
Props
Child components that need access to MuJoCo.
Called if the WASM module fails to load.
useMujocoWasm Hook
Access the WASM module status from any child component:Return Value
| Field | Type | Description |
|---|---|---|
mujoco | MujocoModule | null | The raw WASM module, or null while pending |
status | 'pending' | 'error' | Current lifecycle state (absent once loaded) |
error | string | null | Error message if loading failed |
Notes
- Must wrap any component that uses
MujocoCanvasor mujoco-react hooks - The WASM module is loaded once on mount. The embedded binary in
mujoco-jsis ~2MB. - Loading typically takes 1-3 seconds on first visit; subsequent visits use the browser cache