diff --git a/opentech/static_src/src/app/src/components/Listing/index.js b/opentech/static_src/src/app/src/components/Listing/index.js index 02e7453ef3d269a0087437c19b334a1b7a3d1da9..9d254f897522ca7e768cd9581066b487b8cb3789 100644 --- a/opentech/static_src/src/app/src/components/Listing/index.js +++ b/opentech/static_src/src/app/src/components/Listing/index.js @@ -19,6 +19,11 @@ export default class Listing extends React.Component { handleRetry: PropTypes.func, }; + constructor(props) { + super(props); + this.listRef = React.createRef(); + } + renderListItems() { const { isError, @@ -44,7 +49,7 @@ export default class Listing extends React.Component { } return ( - <ul className="listing__list" ref={this.myRef}> + <ul className="listing__list" ref={this.listRef}> {items.map(v => renderItem(v))} </ul> ); @@ -67,9 +72,9 @@ export default class Listing extends React.Component { <div className="listing"> <div className="listing__header"> <ListingDropdown - list={this.myRef.current} + list={this.listRef.current} error={this.props.isLoading} - items={this.state.orderedItems} + items={this.props.items} isLoading={this.props.isLoading} /> </div>