MCPcopy Create free account
hub / github.com/Autodesk/react-base-table / render

Method render

website/src/examples/selection.js:143–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 }
142
143 render() {
144 const {
145 columns,
146 children,
147 selectable,
148 selectionColumnProps,
149 ...rest
150 } = this.props
151 const { selectedRowKeys } = this.state
152
153 // you'd better memoize this operation
154 let _columns = columns || normalizeColumns(children)
155 if (selectable) {
156 const selectionColumn = {
157 width: 40,
158 flexShrink: 0,
159 resizable: false,
160 frozen: Column.FrozenDirection.LEFT,
161 cellRenderer: SelectionCell,
162 ...selectionColumnProps,
163 key: '__selection__',
164 rowKey: this.props.rowKey,
165 selectedRowKeys: selectedRowKeys,
166 onChange: this._handleSelectChange,
167 }
168 _columns = [selectionColumn, ..._columns]
169 }
170
171 return (
172 <StyledTable
173 {...rest}
174 columns={_columns}
175 rowClassName={this._rowClassName}
176 />
177 )
178 }
179}
180
181SelectableTable.defaultProps = {

Callers

nothing calls this directly

Calls 1

normalizeColumnsFunction · 0.85

Tested by

no test coverage detected