ReactJS - Mid-to-Advanced Level
ReactJS - Mid-to-Advanced Level
MID-TO-ADVANCED LEVEL
INTERVIEW
QUESTIONS AND ANSWERS
12. What are render props in React, and how are they
different from higher-order components (HOCs)?
Answer: Render props refer to a pattern where a component’s
child is a function that controls rendering. HOCs, by contrast, are
functions that take a component and return a new component.
Render props offer more flexibility, while HOCs wrap a
component and can modify its behavior.