manifold/web/components/fullscreen-confetti.tsx
Marshall Polaris 4e8b94a28c
Componentize confetti to isolate re-renders due to window size (#740)
* Componentize confetti to isolate re-renders due to window size

* Clean up debug logging
2022-08-11 12:55:25 -07:00

8 lines
293 B
TypeScript

import Confetti, { Props as ConfettiProps } from 'react-confetti'
import { useWindowSize } from 'web/hooks/use-window-size'
export function FullscreenConfetti(props: ConfettiProps) {
const { width, height } = useWindowSize()
return <Confetti {...props} width={width} height={height} />
}