React card revieweasy

What is the difference between State and Props in React?

Props and State are both used to manage data in React.

Props:

  • Passed from parent to child component
  • Read-only
  • Cannot be modified by child component

State:

  • Managed within a component
  • Mutable
  • Can be updated using setState or useState

Example: Props = Data received from parent. State = Data managed inside component.

JB

Jeevan Bhargav

Audited by Creator

This answer is calibrated for technical interviews. Verify benchmarks in local sandboxes before deploying.