Rename TableRow to BodyRow

This commit is contained in:
Wei Zhu 2017-11-18 00:36:22 +08:00
parent 5970dbb1ec
commit 67336fca7b
2 changed files with 7 additions and 7 deletions

View File

@ -15,7 +15,7 @@ import SelectionBox from './SelectionBox';
import SelectionCheckboxAll, { SelectionDecorator } from './SelectionCheckboxAll';
import Column, { ColumnProps } from './Column';
import ColumnGroup from './ColumnGroup';
import createTableRow from './createTableRow';
import createBodyRow from './createBodyRow';
import { flatArray, treeMap, flatFilter, normalizeColumns } from './util';
function noop() {
@ -945,7 +945,7 @@ export default class Table<T> extends React.Component<TableProps<T>, any> {
if (!prevComponents || bodyRow !== preBodyRow) {
this.components.body = {
...components.body,
row: createTableRow(bodyRow),
row: createBodyRow(bodyRow),
};
}
}

View File

@ -3,19 +3,19 @@ import classnames from 'classnames';
import omit from 'omit.js';
import { Store } from './createStore';
interface TableRowProps {
interface BodyRowProps {
store: Store;
className?: string;
rowKey: string;
prefixCls: string;
}
interface TableRowState {
interface BodyRowState {
selected: boolean;
}
export default function createTableRow(Component = 'tr') {
class TableRow extends React.Component<TableRowProps, TableRowState> {
class BodyRow extends React.Component<BodyRowProps, BodyRowState> {
private store: Store;
private unsubscribe: () => void;
@ -52,7 +52,7 @@ export default function createTableRow(Component = 'tr') {
}
render() {
const rowProps = omit(this.props, ['prefixCls', 'rowKey']);
const rowProps = omit(this.props, ['prefixCls', 'rowKey', 'store']);
const className = classnames(
this.props.className,
{
@ -68,5 +68,5 @@ export default function createTableRow(Component = 'tr') {
}
}
return TableRow;
return BodyRow;
}