import type { Fiber } from 'react-reconciler' ; param parent param index returns export function findChildFiberAt ( parent , index ) { let { child } = parent ; if ( child === null ) { return null ; } if ( index === - 1 ) { while ( child . sibling ) { child = child . sibling ; } } else { while ( child . sibling && index > 0 ) { index -= 1 ; child = child . sibling ; } } return child ; } param parent param key returns export function findChildFiber ( parent , key ) { const { child } = parent ; if ( child === null ) { return null ; } if ( child . key === key ) { return child ; } return findSiblingFiber ( child , key ) ; } param parent param key returns export function findPreviousFiber ( parent , key ) { let { child } = parent ; if ( child === null ) { return null ; } if ( child . key === key ) { return parent ; } let { sibling } = child ; while ( sibling ) { if ( sibling . key === key ) { return child ; } child = sibling ; sibling = child . sibling ; } return null ; } param parent param key returns export function findSiblingFiber ( fiber , key ) { let { sibling } = fiber ; while ( sibling && sibling . key !== key ) { sibling = sibling . sibling ; } return sibling ; }