Skip to content

Commit

Permalink
fix: data container repeating items
Browse files Browse the repository at this point in the history
  - data container component no longer repeats items
  - always shows the first result if no filter is applied
  • Loading branch information
benjamin-rocks committed Nov 22, 2019
1 parent b9e16d5 commit 55acb4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/dataContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@
if (loading) return 'loading...';
if (error) return 'failed';

const item = data.results[0];

return (
<>
{data.results.map(item => (
{item && (
<B.GetOneProvider key={item.id} value={item}>
{children}
</B.GetOneProvider>
))}
)}
</>
);
}}
Expand Down

0 comments on commit 55acb4f

Please sign in to comment.