Skip to content

Commit 67c426b

Browse files
authored
Merge pull request #28 from uptick/hotfix/dnd-ref-hack
Update react DND hack to use new ref structure
2 parents e745552 + 3138a42 commit 67c426b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/object-table.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,21 +244,21 @@ class ObjectTable extends React.PureComponent {
244244
}
245245

246246
getRowFromRefs(rowId) {
247-
// Dumb hack to clean up existing hack.
247+
// Dumb hack to clean up existing hack. Accesses underlying elements wrapped in React DnD v8 HOCs.
248248
let row = this.refs[`object-${rowId}`]
249249
// Unwrap
250-
while (row.decoratedComponentInstance) {
251-
row = row.decoratedComponentInstance
250+
while (row.decoratedRef) {
251+
row = row.decoratedRef.current
252252
}
253253
return row
254254
}
255255

256256
getCellFromRefs(rowId, columnKey) {
257-
// Dumb hack to clean up existing hack.
257+
// Dumb hack to clean up existing hack. Accesses underlying elements wrapped in React DnD v8 HOCs.
258258
let cell = this.getRowFromRefs(rowId).refs[`column-${columnKey}`]
259259
// Unwrap
260-
while (cell.decoratedComponentInstance) {
261-
cell = cell.decoratedComponentInstance
260+
while (cell.decoratedRef) {
261+
cell = cell.decoratedRef.current
262262
}
263263
return cell
264264
}

0 commit comments

Comments
 (0)