Skip to content
Discussion options

You must be logged in to vote

I use this PaginatedProp generic in my v7 projects

export type PaginationMetadata = {
  total: number;
  per_page: number;
  current_page: number;
  last_page: number;
  first_page: number;
  first_page_url: string | null;
  last_page_url: string | null;
  next_page_url: string | null;
  previous_page_url: string | null;
};

/**
 * Paginated prop type for Inertia pages
 *
 * Represents a paginated result from Transformer.paginate().
 * Contains the data array and pagination metadata.
 *
 * @template T - The type of items in the data array
 *
 * @example
 * ```tsx
 * import type { PaginatedProp, Data } from '~/types'
 *
 * type Props = {
 *   users: PaginatedProp<Data.User>
 * }
 *
 * expo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tsulatsitamim
Comment options

Answer selected by tsulatsitamim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants