useRef<T> function Null safety

ObjectRef<T> useRef<T>(
  1. T initialValue
)

Creates an object that contains a single mutable property.

Mutating the object's property has no effect. This is useful for sharing state accross build calls, without causing unnecessary rebuilds.

Implementation

ObjectRef<T> useRef<T>(T initialValue) {
  return useMemoized(() => ObjectRef<T>(initialValue));
}