Redux’s connect()
React.memo()
withRouter()
createFragmentContainer()
Error Boundary function
Relay’s createFragmentContainer.
We 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?
If you wrap a component with a HOC that adds a new prop, what happens to the original component’s propTypes and defaultProps?
Our 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.
When deciding between using connect from Redux versus a custom withAuth HOC, what factors would influence your choice in a feature that requires both authentication state and UI theming?
We have a page that composes three HOCs (withRouter, withPermissions, withFeatureToggle). Performance profiling shows extra renders. How would you redesign or optimize this composition?
Explain how you would implement a generic HOC that forwards refs correctly while also injecting props, and why ref forwarding matters in a large component library.
Our legacy codebase uses many HOCs for cross‑cutting concerns, but the new team prefers hooks. How would you plan a migration strategy that minimizes risk and maintains backward compatibility?
At a system‑level, what are the architectural trade‑offs of relying heavily on HOCs for concerns like logging, error handling, and theming across multiple product lines?