QuizzesComponents and Props — Concept Check
intermediate
react

Components and Props — Concept Check

Questions on Components and Props. A component is a function taking props and returning UI. Props are read-only inputs, and treating them as read-only is what keeps a React app predictable.

7 minutes 7 questions Pass at 70%
Time Limit
7 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

7 questions on Components and Props — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.You have a React component that modifies a prop directly. What is a likely consequence?

    • AThe component will re-render continuously.
    • BThe component will not render at all.
    • CThe prop will automatically reset.
    • DThe app may behave unpredictably.
  2. 2.A component is defined inside another component and uses state. What issue might arise?

    • AIt will share state with the parent.
    • BIt will have improved performance.
    • CIt will lose its state on re-render.
    • DIt will not render at all.
  3. 3.In React, why is it recommended to use children for composition over adding more boolean props?

    • AIt reduces the number of renders.
    • BIt prevents state loss.
    • CIt simplifies component logic.
    • DIt makes components more reusable.
  4. 4.You notice a component with many boolean props like showHeader and hideIcon. What should you consider doing?

    • AAdd more props for clarity.
    • BLeave it as is for simplicity.
    • CRefactor to use children for composition.
    • DCombine the props into a single object.
  5. 5.What happens if you destructure props in the function signature but do not provide a default value?

    • AProps will be set to an empty object.
    • BThe component will not render.
    • CIt may lead to undefined props.
    • DProps will automatically be null.
  6. 6.A developer copies an array prop and sorts it inside a component. What is the benefit of this approach?

    • AIt automatically updates the parent component.
    • BIt reduces memory usage.
    • CIt simplifies the sorting logic.
    • DIt prevents mutation of the original array.
  7. 7.Why should a component be split if it is used in more than one place?

    • ATo reduce file size.
    • BTo enhance code reusability.
    • CTo improve rendering speed.
    • DTo simplify state management.