Interface RefObject<T>

A readonly ref container where current cannot be mutated.

Created by createRef, or useRef when passed null.

const ref = createRef<HTMLDivElement>();

ref.current = document.createElement('div'); // Error
interface RefObject<T> {
    current: null | T;
}

Type Parameters

  • T

    The type of the ref's value.

Properties

Properties

current: null | T

The current value of the ref.