How to use the @patternfly/react-table.TableBody.propTypes function in @patternfly/react-table

To help you get started, we’ve selected a few @patternfly/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 patternfly / patternfly-react / packages / patternfly-4 / react-inline-edit-extension / src / components / InlineEdit / editableTableBody.js View on Github external
import React from 'react';
import { TableContext, TableBody, isRowExpanded } from '@patternfly/react-table';

import PropTypes from 'prop-types';
import { TableEditConfirmation } from './constants';
import { showIdWarnings } from './utils/utils';

const propTypes = {
  ...TableBody.propTypes,
  editConfig: PropTypes.shape({
    editConfirmationType: PropTypes.oneOf(Object.values(TableEditConfirmation)),
    onEditCellClicked: PropTypes.func,
    onEditConfirmed: PropTypes.func,
    onEditCanceled: PropTypes.func
  }).isRequired,
  /** Function that is fired when user clicks on a row if not editing.  */
  onRowClick: PropTypes.func
};

const defaultProps = {
  ...TableBody.defaultProps,
  editConfig: null,
  onRowClick: () => undefined
};