Remove unmountComponentAtNode outside of legacy mode (#28650)

This commit is contained in:
Ricky
2024-03-26 16:32:43 -04:00
committed by GitHub
parent f9e5218458
commit cf780b9bd3
+8
View File
@@ -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.');
}