class component

The older way to write a React component, as a JavaScript class with a render method and lifecycle methods.

In more detail

Function components with hooks have replaced classes for new code. Classes are still required for one job: an error boundary, because getDerivedStateFromError and componentDidCatch have no hook equivalent.

Related terms

Taught in

References