dillon1000/react
Commit
Browse files Add warnings for common root API mistakes (#23356)
For createRoot, a common mistake is to pass JSX as the second argument, instead of calling root.render. For hydrateRoot, a common mistake is to forget to pass children as the second argument. The type system will enforce correct usage, but since not everyone uses types we'll log a helpful warning, too.
Changed paths2 files
First-parent comparisonpackages/react-dom/src/__tests__/ReactDOMRoot-test.js ModifiedM packages/react-dom/src/client/ReactDOMRoot.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…