Skip to content

Commit 2e3743b

Browse files
committed
Feature: PadRowComponent prop
1 parent fdb3e77 commit 2e3743b

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.4.0
2+
##### New Features
3+
- `PadRowComponent` - the content rendered inside of a padding row. Defaults to a react component that renders ` `
4+
15
## 6.3.0
26
##### New Features
37
- `defaultSortDesc` - allows you to set the default sorting direction for all columns to descending.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ These are all of the available props (and their default values) for the main `<R
195195
// returning 0, undefined or any falsey value will use subsequent sorts or the index as a tiebreaker
196196
return 0
197197
},
198+
PadRowComponent: () => <span>&nbsp;</span>, // the content rendered inside of a padding row
198199

199200
// Controlled State Overrides (see Fully Controlled Component section)
200201
page: undefined,

src/defaultProps.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,5 @@ export default {
231231
</div>,
232232
NoDataComponent: _.makeTemplateComponent('rt-noData'),
233233
ResizerComponent: _.makeTemplateComponent('rt-resizer'),
234+
PadRowComponent: () => <span>&nbsp;</span>,
234235
}

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
118118
PivotComponent,
119119
AggregatedComponent,
120120
FilterComponent,
121+
PadRowComponent,
121122
// Data model
122123
resolvedData,
123124
allVisibleColumns,
@@ -159,7 +160,6 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
159160
index
160161
]
161162
}
162-
163163
;[pageRows] = recurseRowsViewIndex(pageRows)
164164

165165
const canPrevious = page > 0
@@ -804,7 +804,9 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
804804
maxWidth: `${maxWidth}px`
805805
}}
806806
{...tdProps.rest}
807-
/>
807+
>
808+
{_.normalizeComponent(PadRowComponent)}
809+
</TdComponent>
808810
)
809811
}
810812

0 commit comments

Comments
 (0)