Skip to content

Instantly share code, notes, and snippets.

@steveruizok
Created April 17, 2020 19:08
Show Gist options
  • Save steveruizok/af412eef3f8e116b9fcf0ff1e9c88116 to your computer and use it in GitHub Desktop.
Save steveruizok/af412eef3f8e116b9fcf0ff1e9c88116 to your computer and use it in GitHub Desktop.
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