From 40caafdeb5987caa35da3a9c55bc2418cd83924a Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Wed, 25 Jan 2023 14:23:11 +0100 Subject: [PATCH] made country input tag to show country but returns country code as value --- src/component/Contact/Main.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/component/Contact/Main.js b/src/component/Contact/Main.js index 3eca3b2..b9ec051 100644 --- a/src/component/Contact/Main.js +++ b/src/component/Contact/Main.js @@ -117,14 +117,10 @@ const Main = ({ brdcum }) => { //CALLS THE API AFTER COMPONENT LOADS useEffect(() => { - allCountry().then((data) => setCountries(Object.keys(data.data))).catch((err)=>console.log(err.message)); + allCountry().then((data) => setCountries(Object.entries(data.data))).catch((err)=>console.log(err.message)); }, []); - // useEffect(() => { - // myData - // }, [myData]); - return ( <> {brdcum.b1 && ( @@ -230,8 +226,8 @@ const Main = ({ brdcum }) => { countries.map((country, index) => ( ))} -- 2.34.1