How to determine if component is stateless/functional in React?

Posted by Jessica Taylor | Updated on

Want to determine if component is stateless/functional in React? Class components are inherently stateful, but with the introduction of React hooks functional components are no longer called stateless because they can be stateful, too.

isReactComponent special property exists on React.Component since React 0.14. This allows to determine whether a component is class component.


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