From 8833a38db5e14e2a51b92c0b985c2bb315ad7f60 Mon Sep 17 00:00:00 2001 From: Lucas Bordeau Date: Tue, 16 Jul 2024 17:10:19 +0200 Subject: [PATCH] Fix undefined state from react-router-dom. (#6293) Fix state not well typed from react-router-dom, it can be undefined and we should check for that. --- .../record-show/hooks/useRecordShowPagePagination.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts index 15092daba..0909fcf78 100644 --- a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts +++ b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts @@ -115,7 +115,7 @@ export const useRecordShowPagePagination = ( const { state } = useLocation(); - const cursorFromIndexPage = state.cursor; + const cursorFromIndexPage = state?.cursor; const { loading: loadingCurrentRecord, pageInfo: currentRecordsPageInfo } = useFindManyRecords({