effect-motion
API Referenceeffect-motionNamespacesInstanceFunctions

isInstanceOf

function isInstanceOf<Tag>(tag, u): u is Instance<Tag>;

Function: isInstanceOf()

function isInstanceOf<Tag>(tag, u): u is Instance<Tag>;

Defined in: packages/motion/src/Instance.ts:91

Whether u is an instance of one specific entity kind.

Type Parameters

Type Parameter
Tag extends | "Audio" | "Line" | "Path" | "Rect" | "Circle" | "Ellipse" | "Text" | "Group" | "Hud" | "Image" | "Camera"

Parameters

ParameterTypeDescription
tagTagThe kind to test for, e.g. "Circle".
uunknownThe value to test.

Returns

u is Instance<Tag>

Remarks

Narrows to Instance<Tag>, so a heterogeneous list can be filtered down to the circles and then animated with circle-only fields.

On this page