Home » Javascript » javascript – Can tern complete for methods in React extended classes

javascript – Can tern complete for methods in React extended classes

Posted by: admin February 23, 2020 Leave a comment

Questions:

If I’m extending a React.Component eg.

class MyClass extends React.Component {
    constr// with point here, can this complete "constructor"
}

is it possible to get completions for the React.Component methods eg. constructor?

My current ~/.tern-config does enable the react lib, eg.

{
    "libs": [
        "react",
        // etc.
     ],
     // etc.
}

which does give doc/url info for React.Component, but doesn’t complete for the methods. I’ve read through a fair amount of the tern documentation, but can’t determine if this should be supported or not.

How to&Answers: