Skip to content

Instantly share code, notes, and snippets.

@adnaan
Created November 6, 2016 10:09
Show Gist options
  • Save adnaan/70ef67fef47307bad414e6127de93940 to your computer and use it in GitHub Desktop.
Save adnaan/70ef67fef47307bad414e6127de93940 to your computer and use it in GitHub Desktop.
/*@flow*/
import React from 'react';
import Product from './Product';
function ProductList(props: { data: Array < { ID: number, title: string, vote: number } > , dispatch: Function }) {
return (
<div >
{
props.data.map(product => <Product
key={product.ID}
id={product.ID}
title={product.title}
vote={product.vote}
dispatch={props.dispatch}
/>)
}
</div>
);
}
export default ProductList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment