({ linkId, viewerId }: Props)
| 11 | } |
| 12 | |
| 13 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected