How to use the react-table.ReactTableDefaults.TbodyComponent function in react-table

To help you get started, we’ve selected a few react-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glin / reactable / srcjs / Reactable.js View on Github external
ThComponent.propTypes = {
  HeaderPivoted: PropTypes.node,
  defaultSortOrder: PropTypes.string,
  isSortable: PropTypes.bool,
  isSorted: PropTypes.bool,
  isResizing: PropTypes.bool
}

Object.assign(ReactTableDefaults, {
  ThComponent
})

// Render no data component in table body rather than the entire table
// so it doesn't overlap with headers/filters.
const getTbodyProps = state => ({ state })
const DefaultTbodyComponent = ReactTableDefaults.TbodyComponent
const DefaultNoDataComponent = ReactTableDefaults.NoDataComponent
Object.assign(ReactTableDefaults, {
  TbodyComponent({ state, children, ...rest }) {
    const { pageRows, noDataText } = state
    const noData = !pageRows.length && {noDataText}
    return (
      
        {children}
        {noData}
      
    )
  },
  NoDataComponent() {
    return null
  }
})