Web Development React.js Subjective
Sep 28, 2025

What is the difference between state and props in React?

Detailed Explanation

Props are read-only data passed from parent to child components. State is mutable data managed within a component.

// Props example
function Child({ name }) {
  return <p>Hello {name}</p>;
}

// State example
function Parent() {
  const [count, setCount] = useState(0);
  return <Child name="React" />;
}
Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback