When we use class fields to add methods [...], the class fields are added to the instance itself instead of the prototype.
Interesting, I did not know this before reading your post! For maintainability, I tend to prefer clean code over worrying about micro optimisation details, but I can definitely see this adding performance overhead if lots of these components are needed for an app. I'll certainly bear this in mind when writing future React components!
Interesting, I did not know this before reading your post! For maintainability, I tend to prefer clean code over worrying about micro optimisation details, but I can definitely see this adding performance overhead if lots of these components are needed for an app. I'll certainly bear this in mind when writing future React components!
Agree, quick write & clean code first, optimisation later
I'd verify that bit of information before "bearing that in mind"