What are Props in React

Props in React

Props are how we pass data from one component to another.

In your app, Quiz.jsx sends data into QuestionCard.jsx:

<QuestionCard
  question={currentQuestion.question}
  options={currentQuestion.options}
  onAnswerSelect={handleAnswerSelect}
/>

And then inside QuestionCard.jsx, we receive these values:

function QuestionCard({ question, options, onAnswerSelect }) {
  // JSX that uses the question and options
}

This setup allows components to stay reusable and focused only on what they need to do.