React · Middle · Question 20 of 75
What is the compound components pattern?
- ✓Correct answer: Related parts sharing a context:
<Tabs>,<Tabs.Panel> - 2A component assembled from several nested HOC wrappers
- 3A component that recursively renders itself for nesting
Explanation
The parent holds state and passes it through Context, and the child parts use it. The user composes the markup, as with native <select> and <option>, without a dozen configuration props. Radix UI, Headless UI and Reach UI work this way.