egghead.io
  1. 1
    Error Handling using Error Boundaries in React 16
    6m 1s
  2. 2
    Render Multiple Elements without a Wrapping Element in a Component in React 16
    3m 14s
  3. 3
    Render Text Only Components in React 16
    1m
  4. 4
    Render Elements Outside the Current React Tree using Portals in React 16
    3m 33s
  5. 5
    Define DOM Attributes in React 16
    2m 30s
  6. 6
    Call setState with null to Avoid Triggering an Update in React 16
    1m 18s
  7. 7
    Render Multiple Elements using React.Fragment and the JSX Fragment Syntax <> in React 16.2
    2m 2s
  8. 8
    Create a DOM reference using createRef in React 16.3
    4m 51s
  9. 9
    Forward a DOM reference to another Component using forwardRef in React 16.3
    3m 53s
  10. 10
    Update State Based on Props using the Lifecycle Hook getDerivedStateFromProps in React16.3
    3m 1s
  11. 11
    Capture values using the lifecycle hook getSnapshotBeforeUpdate in React 16.3
    1m 51s
  12. 12
    Pass Data through a Component Tree using Context Providers and Consumers in React 16.3
    5m 53s

Forward a DOM reference to another Component using forwardRef in React 16.3

Nik Graf
InstructorNik Graf
  • react
    React^16.0.0
  • javascript
    JavaScript

Share this video with your friends

Send Tweet

The function forwardRef allows us to extract a ref and pass it to its descendants. This is a powerful tool, but should be used with caution to avoid unexpected ref behaviour. The technique of forwarding refs really starts to shine in combination with higher order components (HOCs).

illustration for Leverage New Features of React 16

Course

Leverage New Features of React 16

Build your Developer Portfolio and climb the engineering career ladder.
  • Search
  • Articles
  • Talks
  • Podcasts
  • Topics
  • Machine
  • Pricing
  • Store
©egghead.io
Terms & Conditions