Giter Site home page Giter Site logo

Comments (4)

glifchits avatar glifchits commented on May 12, 2024

It seems like this would be a feature in ESLint, not just this React plugin. Basically this is a warning/error when you reference a function instead of calling it. I tried searching the ESLint docs for it but I couldn't find anything. I don't know much about ESLint but is it even capable of knowing a variable's type? It seems like quite a challenge, esp. when you consider that we are concerned with object methods (eg. this.isMounted), and globals (which are often functions). Now that I think of it, the global config that is available in ESLint makes no distinction as to its type, so it seems quite unlikely that this feature can exist. Am I right?

from eslint-plugin-react.

lencioni avatar lencioni commented on May 12, 2024

Basically this is a warning/error when you reference a function instead of calling it.

A general rule like that might be useful, but I think it would be difficult to implement. This request is specifically for this.isMounted in React components.

from eslint-plugin-react.

tleunen avatar tleunen commented on May 12, 2024

Not sure it's worth to work on that one...

This method is not available on ES6 class components that extend React.Component. It may be removed entirely in a future version of React.
https://facebook.github.io/react/docs/component-api.html#ismounted

from eslint-plugin-react.

lencioni avatar lencioni commented on May 12, 2024

Indeed, it looks like isMounted is going away. facebook/react#5465

Perhaps there should be a rule that prevents the use of it entirely?

from eslint-plugin-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.