import useWindowSize from "react-use/lib/useWindowSize" ; import { default as ReactConfetti } from "react-confetti" ; import { useContext } from "react" ; import { QuestionContext } from "./Question" ; interface WindowDimensions { width : number ; height : number ; } const Confetti = ( ) => { const { state } = useContext ( QuestionContext ) ; const { width , height } = useWindowSize ( ) ; return ( state ?. correct && ( < ReactConfetti width = { width } height = { height } recycle = { false } / > ) ) ; } ; export default Confetti ;