Skip to content

ecsia-monorepo / react/src / useTarget

Function: useTarget()

ts
function useTarget(handle, relation): EntityHandle | undefined;

Defined in: react/src/hooks.ts:77

The single target of relation on handle, or undefined when none — the exclusive-relation ergonomic (a ChildOf parent, a Targeting victim). Same subscription and re-render cut as useTargets; for a non-exclusive relation this is its first target.

Parameters

ParameterType
handleEntityHandle
relationRelationLike

Returns

EntityHandle | undefined

MIT licensed · 0.x, unpublished, experimental.