I'm use to writing methods in react like so:
class Someclass extends Component{
...
someMethod () => ...
}
Latley I've seen a lot of code with static before the method name:
static someMethod() {...}
Methods are defined on the class´s prototype, static methods are not, they are functions on the class itself. You can call a static method without creating the instance of the class.
More information on the subject here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.