Function: usePreprints()
usePreprints(
params):UseQueryResult<never,Error>
Defined in: web/lib/hooks/use-preprint.ts:138
Fetches a paginated list of preprints.
Parameters
params
UsePreprintsParams = {}
Query parameters (limit, cursor, field)
Returns
UseQueryResult<never, Error>
Query result with preprint list
Remarks
Uses placeholder data to show previous results while fetching new ones, providing a smoother pagination experience.
Example
const { data, isLoading, error } = usePreprints({
field: 'computer-science',
limit: 20,
});
return (
<PreprintList
preprints={data?.preprints ?? []}
isLoading={isLoading}
/>
);
Throws
When the preprints API request fails