K
K
Ken Jee2018-08-19 18:38:22
phpstorm
Ken Jee, 2018-08-19 18:38:22

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?
5b798e7079d76536769504.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Romanov, 2018-11-07
@Djaler

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 question

Ask a Question

731 491 924 answers to any question