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.

React v0.14.0 Do not access .getDOMNode()

See original GitHub issue

I just switched to React 0.14.0 and I’m getting below warning: ReactDOMComponent: Do not access .getDOMNode() of a DOM node; instead, use the node directly. This DOM node was rendered by Typeahead.

componentWillMount this.onCity = function(city){ if (this.props.action) { Dispatcher.dispatch(this.props.action, { country: ReactDOM.findDOMNode(this.refs.country).value, city: city }); } }.bind(this); render (<Typeahead options={cities} maxVisible={2} onOptionSelected={this.onCity} value={this.props.city} />

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
fmrcommented, Oct 14, 2015

Hi @bobiblazeski,

What happens if you change:

{
  country: ReactDOM.findDOMNode(this.refs.country).value,
...
}

to:

{
  country: this.refs.country.value
...
}

?

0reactions
SylarRubycommented, Oct 25, 2015

@fmoo Thanks. Solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React v0.14 – React Blog
As with refs, this change does not affect custom components. With this change, we're deprecating .getDOMNode() and replacing it with ReactDOM.
Read more >
ReactJS findDOMNode and getDOMNode are not functions
14.0 is out of the React core, so I made a few changes to my code: var React = require('react'); var ReactDOM =...
Read more >
ReactJS findDOMNode and getDOMNode are not functions
I'm building a web-app with ReactJS and Flux and I'm trying to get the node of my current div using the method findDOMNode...
Read more >
React.js (v0.14) cheatsheet - Devhints
setState() . These are not called for initial renders. See reference. Unmounting. componentWillUnmount(), Invoked before DOM ...
Read more >
React v0.13.0 Release - GitClear
findDOMNode(component) , which should be used in place of component.getDOMNode() . The base class for ES6-based components will not have getDOMNode .
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