Skip to content

Conversation

@hodayakaro123
Copy link

No description provided.

Copy link
Member

@Tamir198 Tamir198 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left you some comments


// "name": "Åland Islands",
// "flag": "https://flagcdn.com/w320/ax.png",
// "population": 21225,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

return (
<Country
key={card.name}
name={card.name}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add another props to you Card component like this :

export const Country = ({ name, flag, population, region, capital, ...props }) => { 
  return (
    <div {...props}>
      <img src={flag} alt={`${name} flag`} width="100" />
      <h2>{name}</h2>
      <p>Population: {population.toLocaleString()}</p>
      <p>Region: {region}</p>
      <p>Capital: {capital}</p>
    </div>
  );
};

Then all you need to do it call you component like this:

<Country
     //Your props goes in here
      {...country}}
>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants