A

Admin • 833K Points
Coach

Q. How do you pass data from a child component to a parent component in React?

  • (A) By passing a callback function from the parent to the child and invoking it with data
  • (B) By using props directly from the child
  • (C) By using the Context API only
  • (D) By modifying the parent's state directly
  • Correct Answer - Option(A)
  • Views: 27
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin

Data flows down via props; child can send data up via callbacks.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.