Improve memoization of page rendering

This commit is contained in:
schroda
2024-12-22 00:42:33 +01:00
parent 58c402dd0e
commit 34ad331a71
8 changed files with 178 additions and 135 deletions

View File

@@ -26,8 +26,10 @@ const BaseReaderPagedPager = ({
createPage={(page, pagesIndex, shouldLoad, shouldDisplay) =>
createReaderPage(
page,
() => onLoad?.(pagesIndex),
() => onError?.(page.primary.index),
pagesIndex,
true,
onLoad,
onError,
shouldLoad,
shouldDisplay && currentPageIndex === page.primary.index,
currentPageIndex,