We can pass data from child to parent using a callback function passed as a prop from parent to children, this callback will be called to update parent with the data in child component.
You have a Child component that renders a button. When the button is clicked, the Parent needs to know the click happened. How would you implement this?
Suppose the Child component contains a text input and you need to display the entered value in the Parent. Walk me through the steps you'd take.
We have a form split across several child components, and the Parent must collect all field values to submit. The current design uses callbacks passed down, but the form sometimes loses data after a child re‑renders. What could be causing this and how would you fix it?
During a refactor, a child component that used to call a prop function to update the Parent's state started throwing 'undefined is not a function'. What debugging steps would you take and how would you restore the data flow?
In a large dashboard, dozens of nested child components need to report status updates to a top‑level container. Compare using lifted state via callbacks versus React Context or a state‑management library. Which would you choose and why?
You notice that frequent child‑to‑parent callbacks are causing unnecessary re‑renders of the Parent and its siblings, hurting performance. How would you mitigate this while preserving the data flow?
Our legacy codebase relies heavily on prop drilling for child‑to‑parent communication across many layers, making new feature work painful. Propose a migration strategy to a more scalable solution, considering backward compatibility and team adoption.
We are planning a micro‑frontend architecture where each micro‑frontend is a React app that needs to send events to a host container. How would you design the communication mechanism, and what trade‑offs does it have compared to traditional prop callbacks?