framer-motion 7.6.16 → 7.6.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.
package/dist/cjs/index.js CHANGED
@@ -2257,7 +2257,7 @@ class MotionValue {
2257
2257
  * This will be replaced by the build step with the latest version number.
2258
2258
  * When MotionValues are provided to motion components, warn if versions are mixed.
2259
2259
  */
2260
- this.version = "7.6.16";
2260
+ this.version = "7.6.17";
2261
2261
  /**
2262
2262
  * Duration, in milliseconds, since last updating frame.
2263
2263
  *
@@ -4534,7 +4534,7 @@ function updateMotionValuesFromProps(element, next, prev) {
4534
4534
  * and warn against mismatches.
4535
4535
  */
4536
4536
  if (process.env.NODE_ENV === "development") {
4537
- warnOnce(nextValue.version === "7.6.16", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.16 may not work as expected.`);
4537
+ warnOnce(nextValue.version === "7.6.17", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.17 may not work as expected.`);
4538
4538
  }
4539
4539
  }
4540
4540
  else if (isMotionValue(prevValue)) {
@@ -7645,8 +7645,10 @@ function transform(...args) {
7645
7645
 
7646
7646
  function useOnChange(value, callback) {
7647
7647
  useIsomorphicLayoutEffect(() => {
7648
- if (isMotionValue(value))
7648
+ if (isMotionValue(value)) {
7649
+ callback(value.get());
7649
7650
  return value.onChange(callback);
7651
+ }
7650
7652
  }, [value, callback]);
7651
7653
  }
7652
7654
  function useMultiOnChange(values, handler, cleanup) {
@@ -22,7 +22,7 @@ function updateMotionValuesFromProps(element, next, prev) {
22
22
  * and warn against mismatches.
23
23
  */
24
24
  if (process.env.NODE_ENV === "development") {
25
- warnOnce(nextValue.version === "7.6.16", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.16 may not work as expected.`);
25
+ warnOnce(nextValue.version === "7.6.17", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.17 may not work as expected.`);
26
26
  }
27
27
  }
28
28
  else if (isMotionValue(prevValue)) {
@@ -24,7 +24,7 @@ class MotionValue {
24
24
  * This will be replaced by the build step with the latest version number.
25
25
  * When MotionValues are provided to motion components, warn if versions are mixed.
26
26
  */
27
- this.version = "7.6.16";
27
+ this.version = "7.6.17";
28
28
  /**
29
29
  * Duration, in milliseconds, since last updating frame.
30
30
  *
@@ -3,8 +3,10 @@ import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs';
3
3
 
4
4
  function useOnChange(value, callback) {
5
5
  useIsomorphicLayoutEffect(() => {
6
- if (isMotionValue(value))
6
+ if (isMotionValue(value)) {
7
+ callback(value.get());
7
8
  return value.onChange(callback);
9
+ }
8
10
  }, [value, callback]);
9
11
  }
10
12
  function useMultiOnChange(values, handler, cleanup) {
@@ -3425,7 +3425,7 @@
3425
3425
  * This will be replaced by the build step with the latest version number.
3426
3426
  * When MotionValues are provided to motion components, warn if versions are mixed.
3427
3427
  */
3428
- this.version = "7.6.16";
3428
+ this.version = "7.6.17";
3429
3429
  /**
3430
3430
  * Duration, in milliseconds, since last updating frame.
3431
3431
  *
@@ -5702,7 +5702,7 @@
5702
5702
  * and warn against mismatches.
5703
5703
  */
5704
5704
  {
5705
- warnOnce(nextValue.version === "7.6.16", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.16 may not work as expected.`);
5705
+ warnOnce(nextValue.version === "7.6.17", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.17 may not work as expected.`);
5706
5706
  }
5707
5707
  }
5708
5708
  else if (isMotionValue(prevValue)) {
@@ -8813,8 +8813,10 @@
8813
8813
 
8814
8814
  function useOnChange(value, callback) {
8815
8815
  useIsomorphicLayoutEffect(() => {
8816
- if (isMotionValue(value))
8816
+ if (isMotionValue(value)) {
8817
+ callback(value.get());
8817
8818
  return value.onChange(callback);
8819
+ }
8818
8820
  }, [value, callback]);
8819
8821
  }
8820
8822
  function useMultiOnChange(values, handler, cleanup) {