What is the function of the key attribute in the p tag? I inspected the dom, and I expected to see p tags for each element of the taco list as expressed in <p taco-1>
, but it's just <p>
. Any explanation will be much appreciated.
{this.props.tacos.map( ( taco, i ) => {
return <p key={ `taco-${ i }` }>{ taco }</p>;
})}