Skip to content

API Reference / @gtkx/testing / getQueriesForElement

Variable: getQueriesForElement

const getQueriesForElement: <Q>(container, queries?) => BoundQueries & BoundCustomQueries<Q>

Defined in: packages/testing/dist/within.d.ts:13

Binds the built-in queries, and any custom queries, to a specific container so they search only within that scope. Also exported as getQueriesForElement, which reads better in library code.

Type Parameters

Q

Q extends QueryMap = Record<never, never>

Parameters

container

Container

The scope the returned queries operate on.

queries?

Q

Optional custom queries to bind alongside the built-in ones.

Returns

BoundQueries & BoundCustomQueries<Q>

The queries bound to the container.

Released under the MPL-2.0 License.