Feature: improved findAll
method
#1181
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Describe the Feature
We currently use
ReactTestInstance.findAll
method in order to traverse element tree. This is a basic tree walking algorithm that starts at the root and traverses recursively to the children.There is one major issue with the current method: for query predicates that inspect all descendants (e.g. concat all string content) there is no easy way to find only the deepest element matching given predicate.
When using a predict that will concat all nested string contents, then both outer and inner text will be matched.
Possible Implementations
This should be a function, with similar signature:
options
argument. Proposed initial option name:deepestOnly
(defaultfalse
)predicate
callback to facilitate thisApplications
*ByText
or*ByRole
withname
optionThe text was updated successfully, but these errors were encountered: