MCPcopy Create free account
hub / github.com/emwalker/digraph / EditLinkLoader

Function EditLinkLoader

client/src/components/ui/Link/EditLinkLoader/index.tsx:13–32  ·  view source on GitHub ↗
({ linkId, viewerId }: Props)

Source from the content-addressed store, hash-verified

11}
12
13export default function EditLinkLoader({ linkId, viewerId }: Props) {
14 const environment = useRelayEnvironment()
15 const emptyQueryRef = {} as PreloadedQuery<EditLinkQueryType>
16 const [queryRef, setQueryRef] = useState(emptyQueryRef)
17
18 useEffect(() => {
19 const newQueryRef = loadQuery<EditLinkQueryType>(
20 environment,
21 EditLinkQuery,
22 { linkId, viewerId },
23 )
24 setQueryRef(newQueryRef)
25 }, [setQueryRef, viewerId])
26
27 return (
28 <Suspense fallback={<div>Loading ...</div>}>
29 {queryRef !== emptyQueryRef && <EditLinkContainer queryRef={queryRef} />}
30 </Suspense>
31 )
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected