Fix falling in dev mode (#12407)

FiberNode stateNode could be null

So I get TypeError:

```
  at performWorkOnRoot (/tmp/my-project/node_modules/react-dom/cjs/react-dom.development.js:11014:24) TypeError: Cannot read property '_warnedAboutRefsInRender' of null
          at findDOMNode (/tmp/my-project/node_modules/react-dom/cjs/react-dom.development.js:15264:55)
```
This commit is contained in:
Vasiliy
2018-03-21 12:41:50 +03:00
committed by Dan Abramov
parent ab4dc50146
commit 33eddbc0c8

View File

@@ -1126,7 +1126,7 @@ const ReactDOM: Object = {
): null | Element | Text {
if (__DEV__) {
let owner = (ReactCurrentOwner.current: any);
if (owner !== null) {
if (owner !== null && owner.stateNode !== null) {
const warnedAboutRefsInRender =
owner.stateNode._warnedAboutRefsInRender;
warning(