AaronCCWong / react-card-flip

React component for card flipping animation.
https://aaronccwong.github.io/react-card-flip
MIT License
337 stars 64 forks source link

example using the State Hook no readme :) #113

Open tamaracosta opened 1 year ago

tamaracosta commented 1 year ago

import { useState } from 'react'; import ReactCardFlip from 'react-card-flip';

const Card = () => { const [isFlipped, setIsFlipped] = useState(false)

function handleClick(e) { e.preventDefault(); setIsFlipped(!isFlipped); }

return ( <>

This is the front of the card. This is the back of the card.
</>

) }

export default Card;