• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

clippingkk / web / #1178

21 Aug 2025 10:49AM UTC coverage: 0.523% (-0.02%) from 0.546%
#1178

push

web-flow
Merge c060881fd into 4eea96e38

30 of 448 branches covered (6.7%)

Branch coverage included in aggregate %.

12 of 7134 new or added lines in 368 files covered. (0.17%)

3 existing lines in 3 files now uncovered.

147 of 33423 relevant lines covered (0.44%)

8.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/components/SimpleAnimation/HideUntilLoaded.tsx
1
'use client'
×
NEW
2
import type React from 'react'
×
NEW
3
import { useEffect, useState } from 'react'
×
4

×
5
type HideUntilLoadedProps = {
×
6
  imageToLoad: string
×
7
  children: React.ReactElement
×
8
}
×
9

×
10
function HideUntilLoaded(props: HideUntilLoadedProps) {
×
NEW
11
  const [loaded, setLoaded] = useState(false)
×
12
  const [errored, setErrored] = useState(false)
×
13

×
14
  useEffect(() => {
×
15
    const img = document.createElement('img')
×
16
    setLoaded(false)
×
17
    setErrored(false)
×
NEW
18
    img.onload = () => {
×
19
      setLoaded(true)
×
20
    }
×
21
    img.onerror = () => {
×
22
      setErrored(true)
×
23
    }
×
24
    img.src = props.imageToLoad
×
25
  }, [props.imageToLoad])
×
26
  if (errored) {
×
NEW
27
    return props.children
×
28
  }
×
29

×
30
  if (!loaded && process.browser) {
×
31
    return null
×
32
  }
×
33

×
34
  return props.children
×
35
}
×
36

×
37
export default HideUntilLoaded
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc