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.
This commit is contained in:
@ -115,7 +115,7 @@ export const useRecordShowPagePagination = (
|
|||||||
|
|
||||||
const { state } = useLocation();
|
const { state } = useLocation();
|
||||||
|
|
||||||
const cursorFromIndexPage = state.cursor;
|
const cursorFromIndexPage = state?.cursor;
|
||||||
|
|
||||||
const { loading: loadingCurrentRecord, pageInfo: currentRecordsPageInfo } =
|
const { loading: loadingCurrentRecord, pageInfo: currentRecordsPageInfo } =
|
||||||
useFindManyRecords({
|
useFindManyRecords({
|
||||||
|
|||||||
Reference in New Issue
Block a user