framer-motion 12.24.5 → 12.24.7

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.
@@ -2970,15 +2970,23 @@ class VisualElement {
2970
2970
  this.removeFromVariantTree = this.parent.addVariantChild(this);
2971
2971
  }
2972
2972
  this.values.forEach((value, key) => this.bindToMotionValue(key, value));
2973
- if (!hasReducedMotionListener.current) {
2974
- initPrefersReducedMotion();
2975
- }
2976
- this.shouldReduceMotion =
2977
- this.reducedMotionConfig === "never"
2978
- ? false
2979
- : this.reducedMotionConfig === "always"
2980
- ? true
2981
- : prefersReducedMotion.current;
2973
+ /**
2974
+ * Determine reduced motion preference. Only initialize the matchMedia
2975
+ * listener if we actually need the dynamic value (i.e., when config
2976
+ * is neither "never" nor "always").
2977
+ */
2978
+ if (this.reducedMotionConfig === "never") {
2979
+ this.shouldReduceMotion = false;
2980
+ }
2981
+ else if (this.reducedMotionConfig === "always") {
2982
+ this.shouldReduceMotion = true;
2983
+ }
2984
+ else {
2985
+ if (!hasReducedMotionListener.current) {
2986
+ initPrefersReducedMotion();
2987
+ }
2988
+ this.shouldReduceMotion = prefersReducedMotion.current;
2989
+ }
2982
2990
  if (process.env.NODE_ENV !== "production") {
2983
2991
  motionUtils.warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled");
2984
2992
  }
@@ -6351,4 +6359,4 @@ exports.useIsPresent = useIsPresent;
6351
6359
  exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
6352
6360
  exports.usePresence = usePresence;
6353
6361
  exports.visualElementStore = visualElementStore;
6354
- //# sourceMappingURL=feature-bundle-BwaqZAbT.js.map
6362
+ //# sourceMappingURL=feature-bundle-C6mMBZjn.js.map