mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
* Add check for string and null 'rootElement' in ReactDOMFiber **what is the change?:** Before we call 'rootElement.getAttribute' we check that the method is defined. **why make this change?:** There is an internal use case I found where 'rootElement' is a string and null at different points as the page is rendered. It looks like this method was added as part of support for re-hydration of server-side rendered content. I can't imagine we would want to reuse content if the rootnode is a string or null. Not sure if we want an earlier check that it's an element before this point. **test plan:** `yarn test` and I manually tested this fix in the internal case where it was breaking * Add test and improve check for non-element rootElement **what is the change?:** We use the nodeType to check that we have the correct type of rootElement, and we added a unit test. **why make this change?:** Improve this solution to the problem. **test plan:** `yarn test` * run ./scripts/fiber/record-tests