October 2019
Intermediate to advanced
426 pages
11h 49m
English
This Hook returns a mutable ref object, where the .current property is initialized to the passed argument (initialValue). We can use it as follows:
import { useRef } from 'react'const refContainer = useRef(initialValue)
The useRef Hook is used to deal with references to elements and components in React. We can set a reference by passing the ref prop to an element or a component, as follows: <ComponentName ref={refContainer} />
Read now
Unlock full access