Skip to content

Commit bff9384

Browse files
committed
fix complete challenge animation
1 parent a84c743 commit bff9384

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/components/CongratulateModal/CongratulateModal.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import { Component } from "react";
2-
import Confetti from "react-dom-confetti";
2+
import ConfettiModule from "react-dom-confetti";
33
import { FormattedMessage } from "react-intl";
44
import Modal from "../Modal/Modal";
55
import SvgSymbol from "../SvgSymbol/SvgSymbol";
66
import messages from "./Messages";
77
import "./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

0 commit comments

Comments
 (0)