Skip to content

Commit

Permalink
Merge pull request #961 from habx/fix/6.7/footer-render
Browse files Browse the repository at this point in the history
APP-20868: Fix footer render
  • Loading branch information
habx-auto-merge[bot] authored May 7, 2021
2 parents e8678ff + 9052c94 commit 0e3258d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Table/TableFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { HeaderGroup } from 'react-table'
import { HeaderGroup, emptyRenderer } from 'react-table'

import { TableCell, TableFooterRow, TableFooterContainer } from './Table.style'

Expand All @@ -10,11 +10,10 @@ export const TableFooter = <D extends {}>({
<TableFooterContainer>
{footerGroups.map((group) => {
if (
group.headers.every(
(column) =>
((column as unknown) as { Footer: Function }).Footer?.name ===
'emptyRenderer'
)
group.headers.every((column) => {
const Footer = ((column as unknown) as { Footer: Function }).Footer
return !Footer || Footer === emptyRenderer
})
) {
return null
}
Expand Down
5 changes: 5 additions & 0 deletions src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'react-table'

declare module 'react-table' {
export const emptyRenderer: Function
}

0 comments on commit 0e3258d

Please sign in to comment.