-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/skip-mount-animations
- Loading branch information
Showing
22 changed files
with
203 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as React from "react" | ||
import { motion } from "framer-motion" | ||
|
||
const styleA = { | ||
width: 200, | ||
height: 200, | ||
borderRadius: 20, | ||
} | ||
|
||
export function App() { | ||
const [backgroundColor, setBackgroundColor] = React.useState("darkgray") | ||
React.useEffect(() => { | ||
const listener = () => { | ||
// The re-render will have updateBlockedByResize as true and cause clearMeasurements() to be called. | ||
setBackgroundColor("pink") | ||
} | ||
window.addEventListener("resize", listener) | ||
return () => window.removeEventListener("resize", listener) | ||
}, [backgroundColor]) | ||
|
||
return ( | ||
<motion.div | ||
drag="x" | ||
dragConstraints={{ right: 0, left: 0 }} | ||
style={{ ...styleA, backgroundColor }} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "10.16.5", | ||
"version": "10.16.8", | ||
"packages": [ | ||
"packages/*" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["interrupt-delay-after.html","interrupt-delay-before-accelerated.html","interrupt-delay-before.html","interrupt-spring.html","interrupt-tween-opacity-waapi.html","interrupt-tween-opacity.html","interrupt-tween-transforms.html","interrupt-tween-x.html","persist.html","resync-delay.html","resync.html"] | ||
["interrupt-delay-after.html","interrupt-delay-before-accelerated.html","interrupt-delay-before.html","interrupt-spring.html","interrupt-tween-opacity-waapi.html","interrupt-tween-opacity.html","interrupt-tween-transforms.html","interrupt-tween-x.html","persist.html","resync-delay.html","resync.html","start-after-hydration.html"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
packages/framer-motion/src/animation/optimized-appear/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import { Batcher } from "../../frameloop/types" | ||
import { MotionValue } from "../../value" | ||
|
||
type HandoffFunction = ( | ||
storeId: string, | ||
valueName: string, | ||
value: MotionValue, | ||
sync: Batcher | ||
) => number | ||
|
||
/** | ||
* The window global object acts as a bridge between our inline script | ||
* triggering the optimized appear animations, and Framer Motion. | ||
*/ | ||
declare global { | ||
interface Window { | ||
HandoffAppearAnimations?: ( | ||
storeId: string, | ||
valueName: string, | ||
value: MotionValue, | ||
sync: Batcher | ||
) => number | ||
HandoffAppearAnimations?: false | HandoffFunction | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.