我正在编写一个自定义钩子,并试图创建一个回调引用。我的问题是这个函数设置了ref的current,并且不返回任何东西,但是由于我将它用作ref,typescript对我大喊Property 'current' is missing in type '(代码如下: import React, {useCallback, useRef} from 'react'
const useCustom = (): [RefObject<HTMLDivElement>] =
Alternatively, wrap the definition of 'callbackFunction' in its own useCallback() Hook.(react-hooks/exhaustive-deps)The ref value 'containerRef.current' will likely have changed by theIf this ref points to a node rendered by React, copy '