Skip to main content

Function: usePrefetchReviews()

usePrefetchReviews(): (preprintUri) => void

Defined in: web/lib/hooks/use-review.ts:442

Hook for prefetching reviews on hover/focus.

Returns

Function

Function to prefetch reviews for a preprint

Parameters

preprintUri

string

Returns

void

Remarks

Improves perceived performance by loading review data before the user navigates to a preprint's reviews section.

Example

const prefetchReviews = usePrefetchReviews();

return (
<TabsTrigger
value="reviews"
onMouseEnter={() => prefetchReviews(preprintUri)}
onFocus={() => prefetchReviews(preprintUri)}
>
Reviews
</TabsTrigger>
);