import React from 'react' ; import { setRef } from '../utils' ; export interface UseForkRefHook { < T > ( refOne , refTwo ) : React . Ref < T > ; } param { React . Ref < T > } refOne param { React . Ref < T > } refTwo return { Function export const useForkRef = ( refOne , refTwo ) => { return React . useMemo ( ( ) => { if ( refOne == null && refTwo === null ) { return null ; } return ( refOb ) => { setRef ( refOne , refOb ) ; setRef ( refTwo , refOb ) ; } ; } , [ refOne , refTwo ] ) ; } ;