Design Patterns · Middle · Question 61 of 75
Why did hooks replace most render props and HOCs?
- ✓Correct answer: Hooks share stateful logic without changing the component tree, avoiding wrapper nesting and prop collisions
- 2Render props stopped working in React 18
- 3Hooks are faster at runtime
Explanation
Several hooks compose in one function body; several HOCs create nested wrappers that are hard to debug.