Skip to content

Instantly share code, notes, and snippets.

@bedekelly
Created April 2, 2019 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bedekelly/cbf115e8515423034c67726362500e7b to your computer and use it in GitHub Desktop.
Save bedekelly/cbf115e8515423034c67726362500e7b to your computer and use it in GitHub Desktop.
Broken Pose
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