Skip to content

Commit

Permalink
Remove unmountComponentAtNode outside of legacy mode (#28650)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii authored Mar 26, 2024
1 parent 56efb2e commit 1a6d36b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/react-dom/src/client/ReactDOMLegacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,14 @@ export function unstable_renderSubtreeIntoContainer(
}

export function unmountComponentAtNode(container: Container): boolean {
if (disableLegacyMode) {
if (__DEV__) {
console.error(
'unmountComponentAtNode is no longer supported in React 18. Use root.unmount() instead.',
);
}
throw new Error('ReactDOM: Unsupported Legacy Mode API.');
}
if (!isValidContainerLegacy(container)) {
throw new Error('Target container is not a DOM element.');
}
Expand Down

0 comments on commit 1a6d36b

Please sign in to comment.