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

clippingkk / web / #1027

29 Jan 2025 04:31AM UTC coverage: 0.771% (+0.001%) from 0.77%
#1027

push

AnnatarHe
fix: move index page into server component

31 of 354 branches covered (8.76%)

Branch coverage included in aggregate %.

0 of 48 new or added lines in 14 files covered. (0.0%)

156 of 23913 relevant lines covered (0.65%)

12.13 hits per line

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

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

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

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

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

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

×
35
  return props.children
×
36
}
×
37

×
38
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