MCPcopy Index your code
hub / github.com/primer/react / getCurrentPage

Function getCurrentPage

packages/react/src/DataTable/__tests__/Pagination.test.tsx:258–267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256}
257
258function getCurrentPage() {
259 const page = getPages().find(button => {
260 return button.hasAttribute('aria-current')
261 })
262 if (page) {
263 return page
264 }
265
266 throw new Error('Unable to find a button with `aria-current`')
267}
268
269function getPreviousPage() {
270 return screen.getByRole('button', {

Callers 1

Calls 1

getPagesFunction · 0.85

Tested by

no test coverage detected