Answer the question
In order to leave comments, you need to log in
Why is Method can be static displayed when writing ReactJS code in PhpStorm?
I am learning React. I write component code. When writing some function names, PhpStorm highlights and displays the message Method can be static. Although the code works without errors. What is the point of this message?
Answer the question
In order to leave comments, you need to log in
The bottom line is that this method does not use any properties or methods of the class (that is, it does not need this).
The same thing happens to me when working with Vue. However, however, if you make the method static, everything will break (that's how converting a class to a component works). So I just disable this particular inspection for Vue classes
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question