UNPKG

3d-tiles-renderer

Version:

https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification

29 lines (15 loc) 369 B
import { useEffect } from 'react'; // assign a give target to the set of refs export function useApplyRefs( target, ...refs ) { useEffect( () => { refs.forEach( ref => { if ( ref ) { if ( ref instanceof Function ) { ref( target ); } else { ref.current = target; } } } ); }, [ target, ...refs ] ); // eslint-disable-line }