nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound

AI-powered interview preparation platform. Practice with curated questions, mock interviews, and personalized learning paths to crack your dream tech interview.

Quick Links

  • Technologies
  • Saved Questions
  • Pricing

Company

  • About Us
  • Contact Us

Legal

  • Privacy Policy
  • Terms of Use

© 2026 nextRound. All rights reserved.

TOPIC OVERVIEW

react/Class Components

The original way React components held state and lifecycle logic.

10 QuestionsIntermediateMedium Priority ~11 min read

Class components extend React.Component, hold state on this.state, update it via this.setState, and define what renders in a render() method. Because class methods aren't automatically bound to the instance in JavaScript, event handlers referenced as this.handleClick historically lost their this unless explicitly bound in the constructor or written as arrow function class properties — a common source of 'cannot read property of undefined' bugs before hooks existed.

Class components aren't purely legacy, though — they're still the only way to implement an error boundary, since there's no hook equivalent for componentDidCatch or getDerivedStateFromError yet. Understanding them also matters for reading and maintaining older codebases, and for grasping what shouldComponentUpdate() and React.PureComponent were solving before React.memo existed for function components.

What you'll walk away knowing

The core anatomy: constructor, this.state, this.setState, and render()
Why class methods need explicit binding (or arrow function class fields) to keep the right this
What only class components can still do that function components can't (error boundaries)
How shouldComponentUpdate() and PureComponent relate to render optimization, and their function-component equivalent
1What is the purpose of using the super constructor with a props argument?Intermediate2What are class components?Beginner
All Topics
1
Basics
JSX
State and Props
Components
Function Components
2
Virtual DOM
Reconciliation
Class Components
Lifecycle functions
3
Hooks
useState
useReducer
useMemo
useContext
useCallback
useEffect
Custom Hooks
New Hooks
4
Code Sharing
HOC
Refs
Data Sharing
Events
Context API
5
Redux
Router
CSR-SSR
React APIs
ReactDOM
Strict Mode
6
Performance Optimisation
Security
Sharethis topic

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.