Skip to main content

Variable: rootRef

const rootRef: <T>(modelTypeId, options?) => RefConstructor<T>;

Creates a root ref to an object, which in its snapshot form has an id. A root ref will only be able to resolve references as long as both the Ref and the referenced object share a common root.

Type Parameters​

Type ParameterDescription
T extends objectTarget object type.

Parameters​

ParameterTypeDescription
modelTypeIdstringUnique model type id.
options?RootRefOptions<T>Root reference options.

Returns​

RefConstructor<T>

A function that allows you to construct that type of root reference.