Created
April 2, 2019 15:45
-
-
Save bedekelly/cbf115e8515423034c67726362500e7b to your computer and use it in GitHub Desktop.
Broken Pose
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
import React, { useState } from "react"; | |
import posed from "react-pose"; | |
import "./App.css"; | |
export default function App() { | |
const [fullscreen, setFullscreen] = useState(false); | |
const toggle = () => setFullscreen(!fullscreen); | |
const pose = fullscreen ? 'fullscreen' : 'regular'; | |
const Box = posed.div({ | |
regular: { width: '10vw', height: '10vh', flip: true }, | |
fullscreen: { width: "100vw", height: '100vh', flip: true } | |
}); | |
return <Box className="box" pose={pose} onClick={toggle} />; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment