From a81cb978104a2f77a988dec75f8554850224471e Mon Sep 17 00:00:00 2001 From: Matvii Hodovaniuk Date: Fri, 15 Jan 2021 17:05:35 +0200 Subject: [PATCH] Add the attribute 'key' to div Top level elements inside arrays should have the 'key' attribute set to allow React to efficiently rerender the elements of the array. --- .../14_component_life_cycles_boilerplate/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/14_Day_Component_Life_Cycles/14_component_life_cycles_boilerplate/src/index.js b/14_Day_Component_Life_Cycles/14_component_life_cycles_boilerplate/src/index.js index b9f802e..2990eff 100644 --- a/14_Day_Component_Life_Cycles/14_component_life_cycles_boilerplate/src/index.js +++ b/14_Day_Component_Life_Cycles/14_component_life_cycles_boilerplate/src/index.js @@ -29,9 +29,9 @@ class App extends Component { }) } renderCountries = () => { - return this.state.data.map((country) => { + return this.state.data.map((country, i) => { return ( -
+
{' '} {country.name}{' '}