diff --git a/nx-dev/ui-common/src/lib/flip-card.tsx b/nx-dev/ui-common/src/lib/flip-card.tsx index 0c322a179fdc4..20b7b69469fda 100644 --- a/nx-dev/ui-common/src/lib/flip-card.tsx +++ b/nx-dev/ui-common/src/lib/flip-card.tsx @@ -26,14 +26,11 @@ export function FlipCard({ onClick?: () => void; children: ReactNode; }) { - const [flipped, setFlipped] = useState(() => isFlipped); - return ( { - if (isFlippable && !flipped) { - setFlipped(true); + if (isFlippable && !isFlipped) { onFlip && onFlip(day, true); event.preventDefault(); } else { @@ -42,15 +39,17 @@ export function FlipCard({ }} className={cx( 'block group perspective', - isFlippable && !flipped ? 'cursor-pointer' : 'cursor-default' + isFlippable && !isFlipped ? 'cursor-pointer' : 'cursor-default' )} >