-
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.
Fixing unit conversion batching (#2562)
* Adding breaking test * Batching * Fixing unit conversion
- Loading branch information
1 parent
e9cdc63
commit 7a3a9cd
Showing
5 changed files
with
92 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { motion, AnimatePresence } from "framer-motion" | ||
import * as React from "react" | ||
|
||
export const App = () => { | ||
const output = React.useRef<Array<string | number>>([]) | ||
const ref = React.useRef<HTMLDivElement>(null) | ||
const [state, setState] = React.useState(true) | ||
|
||
return ( | ||
<div style={{ height: 100, width: 200, display: "flex" }}> | ||
<AnimatePresence> | ||
{state ? ( | ||
<motion.div | ||
id="test" | ||
ref={ref} | ||
animate={{ x: "100%", y: "100%", rotate: "-30deg" }} | ||
style={{ width: 200, background: "red" }} | ||
onClick={() => setState(false)} | ||
transition={{ duration: 2 }} | ||
onUpdate={({ x }) => { | ||
output.current.push(x) | ||
}} | ||
onAnimationComplete={() => { | ||
if (output.current[0] === "100%") { | ||
ref.current!.innerHTML = "Error" | ||
} | ||
}} | ||
/> | ||
) : null} | ||
</AnimatePresence> | ||
</div> | ||
) | ||
} |
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
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