@trackunit/react-table-pagination
Advanced tools
Comparing version 0.0.2 to 0.0.4
@@ -7,2 +7,3 @@ 'use strict'; | ||
const defaultPageSize = 50; | ||
/** | ||
@@ -14,3 +15,3 @@ * Custom hook for handling Relay pagination in tables. | ||
*/ | ||
const useRelayPagination = (props = { pageSize: 50 }) => { | ||
const useRelayPagination = (props = { pageSize: defaultPageSize }) => { | ||
const [variables, setVariables] = react.useState({ first: props.pageSize }); | ||
@@ -60,5 +61,5 @@ const [pageInfo, setPageInfo] = react.useState(); | ||
}; | ||
}, [variables, nextPage, previousPage, isLoading, reset, pageInfo]); | ||
}, [props.pageSize, variables, nextPage, previousPage, isLoading, reset, pageInfo]); | ||
}; | ||
exports.useRelayPagination = useRelayPagination; |
import { useState, useCallback, useMemo } from 'react'; | ||
const defaultPageSize = 50; | ||
/** | ||
@@ -9,3 +10,3 @@ * Custom hook for handling Relay pagination in tables. | ||
*/ | ||
const useRelayPagination = (props = { pageSize: 50 }) => { | ||
const useRelayPagination = (props = { pageSize: defaultPageSize }) => { | ||
const [variables, setVariables] = useState({ first: props.pageSize }); | ||
@@ -55,5 +56,5 @@ const [pageInfo, setPageInfo] = useState(); | ||
}; | ||
}, [variables, nextPage, previousPage, isLoading, reset, pageInfo]); | ||
}, [props.pageSize, variables, nextPage, previousPage, isLoading, reset, pageInfo]); | ||
}; | ||
export { useRelayPagination }; |
{ | ||
"name": "@trackunit/react-table-pagination", | ||
"version": "0.0.2", | ||
"version": "0.0.4", | ||
"repository": "https://github.com/Trackunit/manager", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.txt", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7873
157