framer-motion 7.10.2 → 7.10.3

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
@@ -80,7 +80,12 @@ function useVisualElement(Component, visualState, props, createVisualElement) {
80
80
  useIsomorphicLayoutEffect(() => {
81
81
  visualElement && visualElement.render();
82
82
  });
83
- React.useEffect(() => {
83
+ /**
84
+ * If we have optimised appear animations to handoff from, trigger animateChanges
85
+ * from a synchronous useLayoutEffect to ensure there's no flash of incorrectly
86
+ * styled component in the event of a hydration error.
87
+ */
88
+ useIsomorphicLayoutEffect(() => {
84
89
  if (visualElement && visualElement.animationState) {
85
90
  visualElement.animationState.animateChanges();
86
91
  }
@@ -2124,7 +2129,7 @@ class MotionValue {
2124
2129
  * This will be replaced by the build step with the latest version number.
2125
2130
  * When MotionValues are provided to motion components, warn if versions are mixed.
2126
2131
  */
2127
- this.version = "7.10.2";
2132
+ this.version = "7.10.3";
2128
2133
  /**
2129
2134
  * Duration, in milliseconds, since last updating frame.
2130
2135
  *
@@ -5932,7 +5937,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5932
5937
  * and warn against mismatches.
5933
5938
  */
5934
5939
  if (process.env.NODE_ENV === "development") {
5935
- warnOnce(nextValue.version === "7.10.2", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.10.2 may not work as expected.`);
5940
+ warnOnce(nextValue.version === "7.10.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.10.3 may not work as expected.`);
5936
5941
  }
5937
5942
  }
5938
5943
  else if (isMotionValue(prevValue)) {
@@ -1,4 +1,4 @@
1
- import { useContext, useRef, useEffect } from 'react';
1
+ import { useContext, useRef } from 'react';
2
2
  import { PresenceContext } from '../../context/PresenceContext.mjs';
3
3
  import { useVisualElementContext } from '../../context/MotionContext/index.mjs';
4
4
  import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
@@ -31,7 +31,12 @@ function useVisualElement(Component, visualState, props, createVisualElement) {
31
31
  useIsomorphicLayoutEffect(() => {
32
32
  visualElement && visualElement.render();
33
33
  });
34
- useEffect(() => {
34
+ /**
35
+ * If we have optimised appear animations to handoff from, trigger animateChanges
36
+ * from a synchronous useLayoutEffect to ensure there's no flash of incorrectly
37
+ * styled component in the event of a hydration error.
38
+ */
39
+ useIsomorphicLayoutEffect(() => {
35
40
  if (visualElement && visualElement.animationState) {
36
41
  visualElement.animationState.animateChanges();
37
42
  }
@@ -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.10.2", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.10.2 may not work as expected.`);
25
+ warnOnce(nextValue.version === "7.10.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.10.3 may not work as expected.`);
26
26
  }
27
27
  }
28
28
  else if (isMotionValue(prevValue)) {
@@ -25,7 +25,7 @@ class MotionValue {
25
25
  * This will be replaced by the build step with the latest version number.
26
26
  * When MotionValues are provided to motion components, warn if versions are mixed.
27
27
  */
28
- this.version = "7.10.2";
28
+ this.version = "7.10.3";
29
29
  /**
30
30
  * Duration, in milliseconds, since last updating frame.
31
31
  *
@@ -78,7 +78,12 @@
78
78
  useIsomorphicLayoutEffect(() => {
79
79
  visualElement && visualElement.render();
80
80
  });
81
- React.useEffect(() => {
81
+ /**
82
+ * If we have optimised appear animations to handoff from, trigger animateChanges
83
+ * from a synchronous useLayoutEffect to ensure there's no flash of incorrectly
84
+ * styled component in the event of a hydration error.
85
+ */
86
+ useIsomorphicLayoutEffect(() => {
82
87
  if (visualElement && visualElement.animationState) {
83
88
  visualElement.animationState.animateChanges();
84
89
  }
@@ -2122,7 +2127,7 @@
2122
2127
  * This will be replaced by the build step with the latest version number.
2123
2128
  * When MotionValues are provided to motion components, warn if versions are mixed.
2124
2129
  */
2125
- this.version = "7.10.2";
2130
+ this.version = "7.10.3";
2126
2131
  /**
2127
2132
  * Duration, in milliseconds, since last updating frame.
2128
2133
  *
@@ -5945,7 +5950,7 @@
5945
5950
  * and warn against mismatches.
5946
5951
  */
5947
5952
  {
5948
- warnOnce(nextValue.version === "7.10.2", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.10.2 may not work as expected.`);
5953
+ warnOnce(nextValue.version === "7.10.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.10.3 may not work as expected.`);
5949
5954
  }
5950
5955
  }
5951
5956
  else if (isMotionValue(prevValue)) {