Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What is the useRef hook used for?
A. To manage state
B. To memoize values
C. To create a mutable object that persists across renders
D. To perform side effects
Direction: Choose the correct option

Q2.

Changing the .current property of a ref does what?
A. Triggers a re-render
B. Causes an error
C. Does not trigger a re-render
D. Updates state
Direction: Choose the correct option

Q3.

Common use cases for useRef include:
A. Accessing DOM elements directly
B. Storing previous values
C. Keeping mutable instance-like variables
D. All of the above
Direction: Choose the correct option

Q4.

How do you access an input element using useRef?
A. <input ref={myRef} /> then myRef.value
B. <input ref={myRef} /> then myRef.current.value
C. <input ref={() => myRef} />
D. <input ref={myRef.current} />
Direction: Choose the correct option

Q5.

Does useRef accept an initial value?
A. Yes, you can pass an initial value like useRef(initialValue)
B. Only for DOM elements
C. Yes, but only strings
D. No, it always starts as null