Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/MyWindowScroller.js b/MyWindowScroller.js
- index a4dbefa..1138fdf 100644
- --- a/MyWindowScroller.js
- +++ b/MyWindowScroller.js
- @@ -15,45 +15,35 @@ class MyWindowScroller extends React.Component {
- render() {
- return (
- <div className="WindowScrollerWrapper">
- - <WindowScroller className='WindowScroller'>
- - {({ height, isScrolling, onChildScroll, scrollTop }) => {
- - return (
- - <AutoSizer disableHeight className='AutoSizer'>
- - {
- - ({ width }) => {
- - //console.log(width, height);
- - if (this.mostRecentWidth && this.mostRecentWidth !== width) {
- - console.log(this.mostRecentWidth, 'clearing cache');
- - this.cache.clearAll();
- - // proxyConsole.js:56 Warning: forceUpdate(...): Cannot update during an existing
- - // state transition (such as within `render` or another component's constructor).
- - // Render methods should be a pure function of props and state; constructor side-effects
- - // are an anti-pattern, but can be moved to `componentWillMount`.
- - // this.listRef.recomputeRowHeights();
- - }
- - this.mostRecentWidth = width;
- - return (
- - <List
- - autoHeight
- - ref={el => { this.listRef = el; }}
- - isScrolling={isScrolling}
- - onScroll={onChildScroll}
- - scrollTop={scrollTop}
- - width={width}
- - height={height}
- - rowCount={this.props.data.length}
- - rowHeight={this.cache.rowHeight}
- - deferredMeasurementCache={this.cache}
- - rowRenderer={this.renderRow}
- - overscanRowCount={0}
- - />
- - );
- - }
- - }
- - </AutoSizer>
- - );
- - }}
- - </WindowScroller>
- + <AutoSizer className='AutoSizer'>
- + {
- + ({ height, width }) => {
- + //console.log(width, height);
- + if (this.mostRecentWidth && this.mostRecentWidth !== width) {
- + console.log(this.mostRecentWidth, 'clearing cache');
- + this.cache.clearAll();
- + // proxyConsole.js:56 Warning: forceUpdate(...): Cannot update during an existing
- + // state transition (such as within `render` or another component's constructor).
- + // Render methods should be a pure function of props and state; constructor side-effects
- + // are an anti-pattern, but can be moved to `componentWillMount`.
- + // this.listRef.recomputeRowHeights();
- + }
- + this.mostRecentWidth = width;
- + return (
- + <List
- + ref={el => { this.listRef = el; }}
- + width={width}
- + height={height}
- + rowCount={this.props.data.length}
- + rowHeight={this.cache.rowHeight}
- + deferredMeasurementCache={this.cache}
- + rowRenderer={this.renderRow}
- + overscanRowCount={0}
- + />
- + );
- + }
- + }
- + </AutoSizer>
- </div>
- );
- }
- diff --git a/flex.css b/flex.css
- index 42d4aee..6c99b4d 100644
- --- a/flex.css
- +++ b/flex.css
- @@ -15,6 +15,10 @@ html, body, #root {
- flex-shrink: 0;
- }
- .App-intro {
- + display: flex;
- + flex-grow: 1;
- +}
- +.WindowScrollerWrapper {
- + display: flex;
- flex-grow: 1;
- - overflow-y: auto;
- }
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment