steveruizok
4/26/2019 - 4:07 PM

Switch Tutorial HandleTap

Switch Tutorial HandleTap

import * as React from "react"
import { Frame } from "framer"

export function Switch() {
    const [state, setState] = React.useState({
        isOn: false,
    })

    const handleTap = () => {
        setState({
            isOn: !state.isOn,
        })
    }

    return (
        <Frame size="100%" onTap={handleTap}>
            {state.isOn.toString()}
        </Frame>
    )
}