@gamelearn/arcade-components 0.25.16 → 0.25.17

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.
@@ -47,12 +47,14 @@ var AnimationComponent = function AnimationComponent(_ref) {
47
47
  var scene = (0, _fiber.useThree)(function (state) {
48
48
  return state.scene;
49
49
  });
50
+ var loader = (0, _react.useMemo)(function () {
51
+ return new _GLTFLoader.GLTFLoader();
52
+ }, []);
50
53
  (0, _react.useEffect)(function () {
51
54
  setMounted(false);
52
55
  }, [resource.elementUid, animation.url]);
53
56
  (0, _react.useEffect)(function () {
54
57
  if (!mounted) {
55
- var loader = new _GLTFLoader.GLTFLoader();
56
58
  var object = scene.getObjectByProperty('elementUid', resource.elementUid);
57
59
 
58
60
  if (object) {
@@ -81,7 +83,7 @@ var AnimationComponent = function AnimationComponent(_ref) {
81
83
  });
82
84
  }
83
85
  }
84
- }, [scene, resource.elementUid, animation.url, loopTimes, emitEvent, mounted]);
86
+ }, [scene, resource.elementUid, animation.url, loopTimes, emitEvent, mounted, loader]);
85
87
  return null;
86
88
  };
87
89
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "license": "Gamelearn",
4
- "version": "0.25.16",
4
+ "version": "0.25.17",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",