Skip to content

Conversation

@Yeti-or
Copy link
Contributor

@Yeti-or Yeti-or commented Mar 20, 2018

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)

I checked react-native-render render in dev it has the same check:
https://github.com/facebook/react/blob/master/packages/react-native-renderer/src/findNodeHandle.js#L73

if (owner !== null && owner.stateNode !== null) {

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)
```
@gaearon
Copy link
Collaborator

gaearon commented Mar 20, 2018

I think this is reasonable but can we get a reproducing case as a test so we don't regress again?
I'd like to better understand why #12299 is happening.

@Yeti-or
Copy link
Contributor Author

Yeti-or commented Mar 20, 2018

@gaearon okay I'll try

@raunofreiberg
Copy link
Contributor

@gaearon https://codesandbox.io/s/4jmz84q147

Might not be what you're quite looking for but I've seen this happen in a similar manner before.

@gaearon gaearon merged commit 33eddbc into facebook:master Mar 21, 2018
@gaearon
Copy link
Collaborator

gaearon commented Mar 21, 2018

OK, I think this is fine to get in but I'd appreciate a follow-up PR with a test so we don't regress.

LeonYuAng3NT pushed a commit to LeonYuAng3NT/react that referenced this pull request Mar 22, 2018
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)
```
@Yeti-or Yeti-or deleted the yeti-or.fix-falling-in-dev-mode branch April 3, 2018 19:09
rhagigi pushed a commit to rhagigi/react that referenced this pull request Apr 19, 2018
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)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants