Skip to Content
react-utilsisRefObject

isRefObject

See source on Github

Checks if a given value is of type RefObject.

  • @param value - The value to check.
  • @returns true if the value is of type RefObject, false otherwise.

Example

const ref = useRef<HTMLDivElement>(null) isRefObject(ref) // true isRefObject({}) // false isRefObject(window) // false