Design Patterns · Middle · Question 62 of 75
How are compound components usually implemented in React?
- ✓Correct answer: The parent holds state and provides it via Context; child parts read it with
useContext - 2The parent clones children with
React.Children.map- the only way - 3Each part fetches state from the server
Explanation
Context works even when parts are wrapped in other elements, unlike cloning children.