PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

React · Theory

Component vs PureComponent

← All stacks

Theory

71/94

Component vs PureComponent

Component re-renders when the parent says so. PureComponent implements shouldComponentUpdate with a shallow compare of props and state — skip if nothing shallow-changed. Function version: React.memo(Comp). New object/array props (style={{}}) still look ‘different’ every time — memo won’t help until you stabilize props.

Component vs PureComponent — output — three lines. New object props {{}} still break PureComponent. Same trap as memo.

Diagram
Parent
    │ props (read-only)
    ▼
  Child → UI
Exam tip

Shallow compare + memo + unstable prop trap.

Example

// PureComponent
console.log("Component: re-render when parent renders");
console.log("PureComponent: skip if props/state shallow-equal");
console.log("function : React.memo(Comp)");

Component vs PureComponent — output: three lines. New object props {{}} still break PureComponent. Same trap as memo.

Short notes

  • Pure : shallow compare, maybe skip render.
  • Fn : React.memo.
  • Trapnew {{}} props every render.

Questions

1

How do you compare Component vs PureComponent on the board? One real difference, one shared idea.

2

What naming trap should you avoid?

3

When would you still pick the other side?

Previous← Comments in ReactNextAngular vs React vs Vue →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.