Difficulty: 5/10reusability, props injection, render propsHOCs are common in third-party React libraries, 1Redux’s connect()2React.memo()3withRouter()4createFragmentContainer()5Error Boundary function6Relay’s createFragmentContainer.Scenario Questions0-2 years experience1We have a Button component that needs to log clicks for analytics. How would you create a higher‑order component to add this logging without changing the Button code?2If you wrap a component with a HOC that adds a new prop, what happens to the original component’s propTypes and defaultProps?2-5 years experience1Our team introduced a withTheme HOC, but after a recent refactor the UI stopped receiving the theme prop. Walk me through how you would debug the issue.Follow-up QuestionsWhat problems can arise if you stack many HOCs together?How would you test a component that is wrapped by an HOC?Can you achieve the same result with hooks, and what trade‑offs exist?Suggest Improvement