Does the statics object work with ES6 classes in React?

Posted by Prem Tiwari | Updated on

Does the statics object work with ES6 classes in React?

No, statics only works with React.createClass():

But you can write statics inside ES6+ classes as below,


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers