# Interface RefObject<T>

A readonly ref container where current cannot be mutated.

Created by createRef, or useRef when passed `null`.

#### Example

    const ref = createRef<HTMLDivElement>();

    ref.current = document.createElement('div'); // Error

interface RefObject<T> {
current: T;
}

#### Type Parameters

- T

  The type of the ref's value.

- Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:150

#####
Index

### Properties

current

## Properties

### `Readonly` current

current: T

The current value of the ref.

- Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:154