Become a member
to unlock all features

Create an egghead account to access 5000+ tutorials and resources from expert developers.

Create account

    Advanced React Component Patterns Update

    This lesson was part of the Advanced React Component Patterns course, which has been updated to reflect the new patterns and API available in React 16.3+.

    Handle ref props with Higher Order Components


    When you wrap a component with a Higher Order Component, it becomes impossible to forward the ref prop down the component tree due to the special nature of the ref prop in React. In this lesson, we’ll see that problem in action with our Higher Order Component. We will pass the ref as an innerRef prop so that the Higher Order Component can re-assign the ref to the component that it is wrapping.