feat(lib/utils/react): get type from predicate in findInReactFiber
This commit is contained in:
parent
5ec7e9bf5c
commit
38d5aa3833
1 changed files with 5 additions and 5 deletions
|
|
@ -21,11 +21,11 @@ export function useReRender() {
|
|||
|
||||
const ReactFiberWalkable = new Set(['props', 'children', 'child', 'sibling'])
|
||||
|
||||
export function findInReactFiber(
|
||||
tree: Extract<ReactNode, { props: unknown }>,
|
||||
filter: SearchFilter,
|
||||
): any {
|
||||
return findInTree(tree, filter, {
|
||||
export function findInReactFiber<F extends SearchFilter>(
|
||||
tree: Extract<ReactNode, object>,
|
||||
filter: F,
|
||||
) {
|
||||
return findInTree<F>(tree, filter, {
|
||||
walkable: ReactFiberWalkable,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue