@cfxjs/react-ui
Version:
Modern and minimalist React UI library.
30 lines (24 loc) • 958 B
JavaScript
import { useRef } from 'react';
var usePaginationHandle = function usePaginationHandle() {
var ref = useRef(null);
return {
setPage: function setPage(value) {
var _ref$current;
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.setPage(value);
},
getPage: function getPage() {
var _ref$current2;
return (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.getPage();
},
setPageSize: function setPageSize(value) {
var _ref$current3;
return (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.setPageSize(value);
},
getPageSize: function getPageSize() {
var _ref$current4;
return (_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.getPageSize();
},
ref: ref
};
};
export default usePaginationHandle;