Hooks

useRef

Retain a mutable container across renders of a component instance without scheduling updates when current changes.

Formal Syntax & Structure

react syntaxreact
const handle = useRef(null);

Working Example

Example Snippetreact
const sequence = useRef(0);
React Reference