Open
Bug 2024756
Opened 8 months ago
Updated 7 months ago
Remove React 16 addEventListener workaround for moz-message-bar dismiss event in toast components
Categories
(Firefox :: New Tab Page, defect, P3)
Firefox
New Tab Page
Tracking
()
NEW
People
(Reporter: maxx, Unassigned)
References
(Blocks 1 open bug)
Details
Summary
HideWidgetsToast and ReportContentToast both use useRef + useEffect + addEventListener("message-bar:user-dismissed", ...) on moz-message-bar to handle dismiss actions. This was required in React 16.
The event name message-bar:user-dismissed contains a colon, which prevents using a JSX on* prop directly.
Options to investigate:
- Check if
moz-message-barexposes a complementary property or callback (e.g.onDismiss) that React 19 can set as a property - Check if the event name can be changed upstream in the
moz-message-barcomponent to a colon-free name (e.g.message-bar-dismissed), allowingonMessageBarDismissed - If neither is feasible, document this as a known limitation with the current
moz-message-barAPI
Files
content-src/components/Notifications/Toasts/HideWidgetsToast.jsxcontent-src/components/Notifications/Toasts/ReportContentToast.jsx
Comment 1•7 months ago
|
||
I don't think we can do this until React 19 is on release.
Severity: -- → S3
Priority: -- → P3
You need to log in
before you can comment on or make changes to this bug.
Description
•