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

no-find-dom-node: Does not detect named imported function #785

Closed
danez opened this issue Aug 24, 2016 · 4 comments
Closed

no-find-dom-node: Does not detect named imported function #785

danez opened this issue Aug 24, 2016 · 4 comments

Comments

@danez
Copy link
Contributor

danez commented Aug 24, 2016

The rule no-find-dom-node does not warn about this:

import { findDOMNode } from 'react-dom';

findDOMNode();
@ljharb ljharb added the bug label Aug 24, 2016
@Hypnosphi
Copy link
Contributor

This makes the rule effectively useless =(

@Hypnosphi
Copy link
Contributor

In fact, it only works if you call some method, like findDOMNode(this).scrollIntoView but doesn't otherwise

@daffy6537
Copy link

daffy6537 commented Dec 14, 2017

Hi,there is a question, I want create a Animation component container, need to use the findDOMNode Api to continuely modify the container's height style, But the plugin claimed me that Line 37: Do not use findDOMNode react/no-find-dom-node, how can I deal with it?

@Hypnosphi
Copy link
Contributor

Two options I see:

  1. Try using refs instead
  2. // eslint-ignore-line react/no-find-dom-node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants