Created
April 17, 2020 19:08
-
-
Save steveruizok/af412eef3f8e116b9fcf0ff1e9c88116 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import * as React from "react" | |
import { Override, Data } from "framer" | |
const appState = Data({ | |
state: "pause", | |
}) | |
export function PlayButton(props): Override { | |
return { | |
onTap: () => { | |
appState.state = "stop" | |
}, | |
} | |
} | |
export function Animation(props): Override { | |
React.useEffect(() => { | |
if (appState.state === "stop") { | |
appState.state = "play" | |
} | |
}, [appState.state]) | |
return { | |
loop: false, // can also set on property controls | |
state: appState.state, // pause, play or stop | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment