Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove findDOMNode from searchbar #185

Merged
merged 1 commit into from Feb 12, 2017
Merged

remove findDOMNode from searchbar #185

merged 1 commit into from Feb 12, 2017

Conversation

ryouaki
Copy link

@ryouaki ryouaki commented Jan 4, 2017

在官网的描述中有如下的描述,官网也不是建议使用这个api,而在配合redux使用的时候,findDOMNode会有返回null的情况(在ref回调中,这里在onclick应该是没问题的)。但是本身searchInput已经存在于this.refs中了。因此没必要再使用findDOMNode了。

ReactDOM.findDOMNode(component)
If this component has been mounted into the DOM, this returns the corresponding native browser DOM element. This method is useful for reading values out of the DOM, such as form field values and performing DOM measurements. In most cases, you can attach a ref to the DOM node and avoid using findDOMNode at all. When render returns null or false, findDOMNode returns null.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 88.553% when pulling e43fcb2 on react-redux-mvvm:master into 21c7ade on weui:master.

@n7best n7best merged commit ace7de6 into weui:master Feb 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants