Page Info
Pagination information is provided through several hooks, as the data becomes available at different stages of React’s rendering and pagination lifecycle.
Using these hooks may cause the page to re-render, which can trigger the pagination engine to run again. To avoid an infinite loop, consider using Layout Suspension to pause the pagination engine for a specific section until all required data is available.
usePageInfo
Gets the current page info within the current section.
const { pageIndex, totalPages } = usePageInfo();
Recipe
Valid Parent
Direct or indirect child of
useSectionInfo
Get information about the current section and its pages.
const { sectionId } : SectionInfo = useSectionInfo();
Recipe
Valid Parent
Direct or indirect child of Section
useReportInfo
Retrieves information about all sections within the report.
const { sections } = useReportInfo();
Recipe
Valid Parent
Direct or indirect child of ReportRoot