useRef<T> function

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 across build calls, without causing unnecessary rebuilds.

Implementation

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