@micromag/core 0.4.21 → 0.4.23

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.
package/es/components.js CHANGED
@@ -39,7 +39,7 @@ import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
39
39
  import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';
40
40
  import { faPercent } from '@fortawesome/free-solid-svg-icons/faPercent';
41
41
  import { getSizeWithinBounds } from '@folklore/size';
42
- import { useSpring } from '@react-spring/core';
42
+ import { useSpringRef, useSpring } from '@react-spring/core';
43
43
  import { config, animated } from '@react-spring/web';
44
44
 
45
45
  /* eslint-disable react/jsx-props-no-spreading */
@@ -2907,8 +2907,13 @@ function Transition(_ref) {
2907
2907
  onStart = _ref$onStart === void 0 ? null : _ref$onStart,
2908
2908
  _ref$onComplete = _ref.onComplete,
2909
2909
  onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete;
2910
+ // In react-spring v10, useSpring(fn) without deps resets the spring on every render
2911
+ // via a layout effect. Passing a SpringRef prevents this reset behavior.
2912
+ var springRef = useSpringRef();
2910
2913
  var _useSpring = useSpring(function () {
2911
- return {};
2914
+ return {
2915
+ ref: springRef
2916
+ };
2912
2917
  }),
2913
2918
  _useSpring2 = _slicedToArray(_useSpring, 2),
2914
2919
  springProps = _useSpring2[0],
package/lib/components.js CHANGED
@@ -2909,8 +2909,13 @@ function Transition(_ref) {
2909
2909
  onStart = _ref$onStart === void 0 ? null : _ref$onStart,
2910
2910
  _ref$onComplete = _ref.onComplete,
2911
2911
  onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete;
2912
+ // In react-spring v10, useSpring(fn) without deps resets the spring on every render
2913
+ // via a layout effect. Passing a SpringRef prevents this reset behavior.
2914
+ var springRef = core.useSpringRef();
2912
2915
  var _useSpring = core.useSpring(function () {
2913
- return {};
2916
+ return {
2917
+ ref: springRef
2918
+ };
2914
2919
  }),
2915
2920
  _useSpring2 = _slicedToArray(_useSpring, 2),
2916
2921
  springProps = _useSpring2[0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/core",
3
- "version": "0.4.21",
3
+ "version": "0.4.23",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -161,6 +161,6 @@
161
161
  "access": "public",
162
162
  "registry": "https://registry.npmjs.org/"
163
163
  },
164
- "gitHead": "34dedbdd988f27c395b838b50dfcd0e48bfa16ee",
164
+ "gitHead": "57c581f5e1758b3d28152f68166cab0468670b92",
165
165
  "types": "es/index.d.ts"
166
166
  }