useRef and forwardRef in React | Learn useRef hook and forwardRef

Опубликовано: 02 Март 2026
на канале: Rajesh Bhattarai
1,873
54

The useRef is a React hook that allows you to directly create a reference to the DOM element and returns a ref object with a single current property initially set to the initial value you provided.

In React forwardRef is a method that allows parent components to pass down ref to their children. The forwardRef gives reference to a DOM element created by its parent component to the child component. This then allows the child to read and modify that element anywhere it is being used.

Connect with me:
Twitter:   / izrajesh  
Instagram:   / irajeshbhattarai  
Medium:   / rajeshi  
Website: https://rajeshbhattarai.com/

Disclaimer:
All videos are for educational purposes and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.

#reactjs #reacthooks