opendevs
Lists and Keys

Refs in React

Loading video...

Refs & the DOM (in Hindi)

Concepts

    1

    Refs & the DOM (in Hindi)
    Refs & the DOM (in Hindi)

    2

    Refs & the DOM - Implementation - Part 1 (in Hindi)
    Refs & the DOM - Implementation - Part 1 (in Hindi)

    3

    Refs & the DOM - Implementation - Part 2 (in Hindi)
    Refs & the DOM - Implementation - Part 2 (in Hindi)

    4

    Refs & the DOM - Implementation - Part 3 (in Hindi)
    Refs & the DOM - Implementation - Part 3 (in Hindi)
Refs is the shorthand used for references in React. It is similar to keys in React. It is an attribute which makes it possible to store a reference to particular DOM nodes or React elements. It provides a way to access React DOM nodes or React elements and how to interact with it. It is used when we want to change the value of a child component, without making the use of props.Finish watching the concept videos to earn    DevCoin image  each
1

Uncontrolled components handle data by React?


Question 1 of 3
2

What will be the value in console on the first render of this code?

import {useRef} from 'react'; export default MyComponent { const myRef = useRef(); console.log(myRef); // <--- Output of this line return ( <p id="tagline" ref={myRef}>Hello there from Dev11</p> ) }

Question 1 of 3
3

Is ref property generally available in HTML elements also?


Question 1 of 3
Practice Problems
StatusTitleDifficultyDevCoin image

easy

easy

medium

Copyright © 2022 opendevs

Learn ● Develop ● Ace
All illustrations by Storyset