synapsecns/sanguine

View on GitHub
packages/synapse-interface/utils/hooks/useIsMounted.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { useState, useEffect } from 'react'

export const useIsMounted = (): boolean => {
  const [mounted, setMounted] = useState<boolean>(false)

  useEffect(() => {
    setMounted(true)
  }, [])

  return mounted
}