import { Fiber } from '../../react-reconciler/ReactInternalTypes' ; import { Props } from '../ReactDOMHostConfig' ; const randomKey = Math . random ( ) . toString ( 36 ) . slice ( 2 ) ; const internalPropsKey = '__reactProps$' + randomKey ; const internalInstanceKey = '__reactFiber$' + randomKey ; export const getFiberCurrentPropsFromNode = ( node ) : Props => { return ( node as any ) [ internalPropsKey ] ; } ; export const getClosestInstanceFromNode = ( targetNode ) : Fiber | null => { const targetInst = ( targetNode as any ) [ internalInstanceKey ] ; return targetInst ?? null ; } ; export const precacheFiberNode = ( hostInst , node ) => { ; ( node as any ) [ internalInstanceKey ] = hostInst ; } ; param node param props export const updateFiberProps = ( node , props ) : void => { ; ( node as any ) [ internalPropsKey ] = props ; } ;