BUG: React.findDOMNode(this) always null in higher-order-component (0.13.3)
See original GitHub issueconst higherOrderComponent = (Component) => React.createClass({
componentDidMount() {
console.log( React.findDOMNode(this) ); // => null
},
render() {
return <Component {...this.props} />;
}
});
Issue Analytics
- State:
- Created 8 years ago
- Comments:16 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The bug only happens if the wrapped component returns null the first time
render()
is called.I did something wrong in my own code @olegerm but I don’t remember what that was anymore.