File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 11import { UploaderInterface , UploaderResult , UploaderOptions } from "uploader" ;
22import React , { useLayoutEffect } from "react" ;
3- import { useElementRef } from "react-uploader /Utils" ;
3+ import { useElementRef } from ". /Utils" ;
44
55interface Props {
66 height ?: string ;
Original file line number Diff line number Diff line change 11import { useCallback , useState } from "react" ;
22
3+ /**
4+ * Unlike 'useRef', 'useElementRef' will trigger a rerender when the reference is updated.
5+ */
36export function useElementRef ( ) : [ HTMLElement | undefined , ( e : HTMLElement | null ) => void ] {
47 const [ element , setElement ] = useState < HTMLElement | undefined > ( undefined ) ;
58 const elementRef = useCallback ( ( e : HTMLElement | null ) => {
You can’t perform that action at this time.
0 commit comments