Skip to content

Commit 2106e55

Browse files
committed
ui: fix findDOMNode console error due to react-virtualized
1 parent 12ea5bb commit 2106e55

File tree

2 files changed

+40
-36
lines changed

2 files changed

+40
-36
lines changed

app/src/components/history/HistoryList.tsx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,28 @@ const HistoryList: React.FC = () => {
2323
<AutoSizer disableHeight>
2424
{({ width }) => (
2525
<WindowScroller>
26-
{({ height, isScrolling, onChildScroll, scrollTop }) => (
26+
{({ height, isScrolling, onChildScroll, scrollTop, registerChild }) => (
2727
<Observer>
2828
{() => (
29-
<List
30-
autoHeight
31-
height={height}
32-
isScrolling={isScrolling}
33-
onScroll={onChildScroll}
34-
rowCount={swapStore.sortedSwaps.length}
35-
rowHeight={ROW_HEIGHT}
36-
rowRenderer={({ index, key, style }) => (
37-
<HistoryRow
38-
key={key}
39-
style={style}
40-
swap={swapStore.sortedSwaps[index]}
41-
/>
42-
)}
43-
scrollTop={scrollTop}
44-
width={width}
45-
/>
29+
<div ref={ref => ref && registerChild(ref)}>
30+
<List
31+
autoHeight
32+
height={height}
33+
isScrolling={isScrolling}
34+
onScroll={onChildScroll}
35+
rowCount={swapStore.sortedSwaps.length}
36+
rowHeight={ROW_HEIGHT}
37+
rowRenderer={({ index, key, style }) => (
38+
<HistoryRow
39+
key={key}
40+
style={style}
41+
swap={swapStore.sortedSwaps[index]}
42+
/>
43+
)}
44+
scrollTop={scrollTop}
45+
width={width}
46+
/>
47+
</div>
4648
)}
4749
</Observer>
4850
)}

app/src/components/loop/ChannelList.tsx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,28 @@ const ChannelList: React.FC = () => {
3838
<AutoSizer disableHeight>
3939
{({ width }) => (
4040
<WindowScroller>
41-
{({ height, isScrolling, onChildScroll, scrollTop }) => (
41+
{({ height, isScrolling, onChildScroll, scrollTop, registerChild }) => (
4242
<Observer>
4343
{() => (
44-
<List
45-
autoHeight
46-
height={height}
47-
isScrolling={isScrolling}
48-
onScroll={onChildScroll}
49-
rowCount={channelStore.sortedChannels.length}
50-
rowHeight={ROW_HEIGHT}
51-
rowRenderer={({ index, key, style }) => (
52-
<ChannelRow
53-
key={key}
54-
style={style}
55-
channel={channelStore.sortedChannels[index]}
56-
/>
57-
)}
58-
scrollTop={scrollTop}
59-
width={width}
60-
/>
44+
<div ref={ref => ref && registerChild(ref)}>
45+
<List
46+
autoHeight
47+
height={height}
48+
isScrolling={isScrolling}
49+
onScroll={onChildScroll}
50+
rowCount={channelStore.sortedChannels.length}
51+
rowHeight={ROW_HEIGHT}
52+
rowRenderer={({ index, key, style }) => (
53+
<ChannelRow
54+
key={key}
55+
style={style}
56+
channel={channelStore.sortedChannels[index]}
57+
/>
58+
)}
59+
scrollTop={scrollTop}
60+
width={width}
61+
/>
62+
</div>
6163
)}
6264
</Observer>
6365
)}

0 commit comments

Comments
 (0)