mujoco-react 7.0.0 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +5 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -70,17 +70,14 @@ Inside `<MujocoCanvas>` or `<MujocoPhysics>`, `useMujoco()` gives you the simula
70
70
  import { useMujoco } from 'mujoco-react';
71
71
 
72
72
  function MyComponent() {
73
- const { api, status } = useMujoco();
74
- const sim = useMujoco();
73
+ const { isPending, isError, error, api, mjModelRef } = useMujoco();
75
74
 
76
- if (!api) return null;
77
- if (sim.isPending) return <span>Loading...</span>;
78
- if (sim.isError) return <span>Error: {sim.error}</span>;
75
+ if (isPending) return <span>Loading...</span>;
76
+ if (isError) return <span>Error: {error}</span>;
79
77
 
80
- // sim.api is fully typed here
81
78
  return (
82
- <button onClick={() => sim.api.reset()}>
83
- Reset ({sim.mjModelRef.current?.nq} joints)
79
+ <button onClick={() => api.reset()}>
80
+ Reset ({mjModelRef.current?.nq} joints)
84
81
  </button>
85
82
  );
86
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mujoco-react",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Composable React Three Fiber building blocks for MuJoCo WASM simulations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",