Files
react/scripts
Flarnie Marchan 045e5bce35 Add check for string and null 'rootElement' in ReactDOMFiber (#9869)
* 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
2017-06-07 07:51:05 -07:00
..
2017-05-18 19:13:59 -04:00
2017-04-20 11:18:33 -07:00