Answers for "how to get the data from api"

-1

get data from api in javascript

const GetData = [];
  useEffect(() => {
    fetch(API_URL)
      .then((res) => res.json())
      .then((data) => {
        GetModesData.push(...data);
        setDataState(GetData.map((d) => d.modeName));
      });
  }, []);
Posted by: Guest on August-16-2020

Code answers related to "how to get the data from api"

Code answers related to "Javascript"

Browse Popular Code Answers by Language