dillon1000/react

Commit

support ReactDOM.render(..., document) without crashing (#26129)

as reported in #26128 `ReactDOM.render(..., document)` crashed when
`enableHostSingletons` was on. This is because it had a different way of
clearing the container than `createRoot(document)`. I updated the legacy
implementation to share the clearing behavior of `creatRoot` which will
preserve the singleton instances.

I also removed the warning saying not to use `document.body` as a
container
Browse files
Changed paths4 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactDOMSingletonComponents-test.js ModifiedM packages/react-dom/src/__tests__/ReactMount-test.js ModifiedM packages/react-dom/src/__tests__/validateDOMNesting-test.js ModifiedM packages/react-dom/src/client/ReactDOMLegacy.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…