Skip to content

Commit

Permalink
list without paginate again, but class as preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
rwieruch committed May 6, 2017
1 parent 9f96151 commit 319a311
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class App extends React.Component {
<button type="button">Search</button>
</form>

<ListWithPaginate
<List
list={this.state.hits}
page={this.state.page}
onPaginatedSearch={this.onPaginatedSearch}
Expand All @@ -76,10 +76,16 @@ const withPaginate = (Component) => ({ page, onPaginatedSearch, ...props }) =>
}
</div>

const List = ({ list, page, onPaginatedSearch }) =>
<div>
{list.map(item => <div key={item.objectID}>{item.title}</div>)}
</div>
class List extends React.Component {
render() {
const { list } = this.props;
return (
<div>
{list.map(item => <div key={item.objectID}>{item.title}</div>)}
</div>
);
}
}

const ListWithPaginate = withPaginate(List);

Expand Down

0 comments on commit 319a311

Please sign in to comment.