question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: React.findDOMNode(this) always null in higher-order-component (0.13.3)

See original GitHub issue
const higherOrderComponent = (Component) => React.createClass({
  componentDidMount() {
    console.log( React.findDOMNode(this) ); // => null
  },

  render() {
    return <Component {...this.props} />;
  }
});

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
gilboxcommented, Jun 5, 2015

The bug only happens if the wrapped component returns null the first time render() is called.

1reaction
gilboxcommented, Oct 2, 2015

I did something wrong in my own code @olegerm but I don’t remember what that was anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React.findDOMNode comes as undefined - Stack Overflow
I get TypeError: React.findDOMNode(...).trim is not a function , which makes sense, since findDOMNode returns a DOM element, not a string ...
Read more >
ReactDOM – React
Returns true if a component was unmounted and false if there was no component to unmount. findDOMNode(). Note: findDOMNode is an escape hatch...
Read more >
react hook before render | The Search Engine You Control
PhantomJS 2.1.1 (Windows 7 0.0.0) component/common/Button render "before all" hook FAILED null is not an object (evaluating 'getReactDOM().
Read more >
CHANGELOG.md - TINMAN
A first step toward converting all the demos to React Hooks (#13873) @adeelibr. - And many more bug fixes and documentation improvements.
Read more >
React-Quickly_-Painl..
The result is the same, except you don't use an extra variable: ReactDOM.render(. React.createElement('h1', null, 'Hello world!'), document.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found