import React from 'react';

const Main = () => {

	const articles = [
		{
			id: 1,
			title: 'Title 1'
		}, {
			id: 2,
			title: 'Title 2'
		}, {
			id: 3,
			title: 'Title 3'
		}
	];

	return (
		<div>
			{articles.map(function(article, index) {
				return (
					<article>
						<h2>{ article.title }</h2>
					</article>
				);
			})}
		</div>
	);
}

export default Main;
import React from 'react';

const Main = () => {

	const articles = [
		{
			id: 1,
			title: 'Title 1'
		}, {
			id: 2,
			title: 'Title 2'
		}, {
			id: 3,
			title: 'Title 3'
		}
	];

	return (
		<div>
			{articles.map(function(article, index) {
				return (
					<article key={ article.id }>
						<h2>{ article.title }</h2>
					</article>
				);
			})}
		</div>
	);
}

export default Main;
Add a unique key to each child in an array
Add a unique key to each child in an array
