Skip to content

Instantly share code, notes, and snippets.

@bedekelly
Last active April 2, 2019 16:07
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/b3f98ceb5498e894339fadc1e453f995 to your computer and use it in GitHub Desktop.
Save bedekelly/b3f98ceb5498e894339fadc1e453f995 to your computer and use it in GitHub Desktop.
Fixed Pose
import React, { useState } from "react";
import posed from "react-pose";
import "./App.css";
const Box = posed.div({
regular: { width: '10vw', height: '10vh', flip: true },
fullscreen: { width: "100vw", height: '100vh', flip: true }
});
export default function App() {
const [fullscreen, setFullscreen] = useState(false);
const toggle = () => setFullscreen(!fullscreen);
const pose = fullscreen ? 'fullscreen' : 'regular';
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