Search Docs
可以通过JS的typeof运算符和React的component类来进行判断:
function isClassComponent(component){ return typeof component === 'function' && !!component.prototype.isReactComponent }