tagChildren
Tags a Taggable Element as a root to track one or more of its children by specifying a set of ChildrenTaggingQuery objects.
tagChildren = (parameters: ChildrenTaggingQueries) => TagLocationReturnValue
danger
tagChildren
is a performance-sensitive API. Avoid using it whenever Location Taggers could be used instead.
Parameters
type | ||
---|---|---|
required | parameters | ChildrenTaggingQueries |
optional | onError | TrackerErrorHandlerCallback |
tagChild - Single query shorthand
Syntactic sugar API built on top of tagChildren which processes a single ChildrenTaggingQuery.
tagChild = (parameters: ChildrenTaggingQuery) => TagLocationReturnValue
Parameters
type | ||
---|---|---|
required | parameters | ChildrenTaggingQuery |
optional | onError | TrackerErrorHandlerCallback |
Returns
Usage example
import { tagChildren, tagPressable } from '@objectiv/tracker-browser';
<div
{...tagChildren([
{
queryAll: 'button[aria-label="Previous"]',
tagAs: tagPressable({ id: 'prev' })
},
{
queryAll: 'button[aria-label="Next"]',
tagAs: tagPressable({ id: 'next' })
}
])}
>
...
</div>