File tree Expand file tree Collapse file tree
src/components/CongratulateModal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Component } from "react" ;
2- import Confetti from "react-dom-confetti" ;
2+ import ConfettiModule from "react-dom-confetti" ;
33import { FormattedMessage } from "react-intl" ;
44import Modal from "../Modal/Modal" ;
55import SvgSymbol from "../SvgSymbol/SvgSymbol" ;
66import messages from "./Messages" ;
77import "./CongratulateModal.scss" ;
88
9+ // react-dom-confetti is Babel-era CJS: `exports.default = Confetti` alongside an
10+ // `__esModule` marker. Vite's dep optimizer doesn't pick up on that marker and
11+ // emits `export default require_confetti()`, so a default import receives the
12+ // whole module object rather than the component. Unwrap it here; the fallback
13+ // covers bundlers that do honor the marker and hand back the class directly.
14+ const Confetti = ConfettiModule ?. default ?? ConfettiModule ;
15+
916/**
1017 * CongratulateModal presents a celebratory modal that displays a
1118 * congratulatory message along with a confetti cannon visual effect
You can’t perform that action at this time.
0 commit comments