React.isValidElement tests true for both React components as well as React elements. How would I test, specifically, that an object is a React component? Curren
React.isValidElement
In addition to @EmanualJade answer, you can use this to check if a variable is a function component
function component
React.isValidElement(Component())
As @Leonardo has pointed out, some compilers can cause this to fail:
String(component).includes('return React.createElement')