Refs in React
A ref is short for reference. A ref is used for referencing a DOM element and interacting with that DOM node directly.
Though this is a step away from React's approach of rendering through props, React's docs specify a few good use cases for Refs:
Managing focus, text selection, or media playback.
Triggering imperative animations.
- Integrating with third-party DOM libraries.
Link to the repo: https://github.com/AkashGutha/egghead-singles/tree/master/20-create-refs