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
| Parameter | Type |
|---|---|
handle | EntityHandle |
relation | RelationLike |
Returns
EntityHandle | undefined