Search code examples
reactjs

React - Are Class based Components fully supported in React?


React - Are Class based Components fully supported in React Or there is limited support for Class based Components in React ?

I want to implement Class based Object Oriented Design approach in React. But, I am not sure whether the Class based Components and Object Oriented Design Approach is fully supported in react or not (including support for hooks, states and all other functionalities)?


Solution

  • According to the official documentation:

    Component is the base class for the React components defined as JavaScript classes. Class components are still supported by React, but we don’t recommend using them in new code.

    It is also stated there that it is recommended to migrate your class components to functions.

    Reference