F
filterInTree
Finds every node in a React element or fiber tree a predicate matches, searching only downward.
Start from an element, a fiber, or a class instance's _reactInternals.
function filterInTree<T = any>(root: any, predicate: TreePredicate, options?: TreeSearchOptions): T[]Parameters
| Name | Type | Description |
|---|---|---|
| root | any | The element or fiber to start from; it is tested too. |
| predicate | TreePredicate | Tests each non-nullish node. |
| options? | TreeSearchOptions |
|
Returns
T[]Every match, in visiting order.