Appearance
unrefElement
Get the DOM element a React ref object currently holds
Demo
Usage
tsx
import { unrefElement } from '@reause/core'
import { useEffect, useRef } from 'react'
const div = useRef<HTMLDivElement>(null)
useEffect(() => {
console.log(unrefElement(div)) // the <div> element (div.current)
})Type Declarations
ts
export type UnRefElementReturn<T> = T | undefined
export function unrefElement<T>(elRef: RefObject<T | null | undefined>): UnRefElementReturn<T>