Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore deprecated ReactDOM methods in Context Menu singleton #7159

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export function showContextMenu(
) {
const {
container = document.body,
// eslint-disable-next-line deprecation/deprecation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some sort of react 18 note to these comments so that we can easily track these down later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Added here eb3f5e3

domRenderer = ReactDOM.render,
// eslint-disable-next-line deprecation/deprecation
domUnmounter = ReactDOM.unmountComponentAtNode,
} = options;

Expand All @@ -65,6 +67,7 @@ export function showContextMenu(
domUnmounter(contextMenuElement);
}

// eslint-disable-next-line deprecation/deprecation
domRenderer(
<OverlaysProvider>
<UncontrolledContextMenuPopover {...props} />
Expand All @@ -81,6 +84,7 @@ export function showContextMenu(
* @see https://blueprintjs.com/docs/#core/components/context-menu-popover.imperative-api
*/
export function hideContextMenu(options: DOMMountOptions<ContextMenuPopoverProps> = {}) {
// eslint-disable-next-line deprecation/deprecation
const { domUnmounter = ReactDOM.unmountComponentAtNode } = options;

if (contextMenuElement !== undefined) {
Expand Down