MCPcopy Create free account
hub / github.com/github/docs / Loading

Function Loading

components/search/Loading.tsx:4–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { useEffect, useState } from 'react'
3
4export function Loading() {
5 const [showLoading, setShowLoading] = useState(false)
6 useEffect(() => {
7 let mounted = true
8 setTimeout(() => {
9 if (mounted) {
10 setShowLoading(true)
11 }
12 }, 1000)
13
14 return () => {
15 mounted = false
16 }
17 }, [])
18 return showLoading ? <ShowSpinner /> : <ShowNothing />
19}
20
21function ShowSpinner() {
22 return (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected