skip to Main Content

Display Output from JS Loop in React Component – Reactjs

import React from "react"; function Api(){ return( fetch('http://universities.hipolabs.com/search?country=Pakistan') .then((api_data) => { return api_data.json(); }) .then((json_data) => { for(let i=0; i<json_data.length; i++){ <div style={{borderWidth:2}}> Serial No: {i} <br /> Name of University: {json_data[i].name} <br /> Province Code: {json_data[i].stateProvince} <br /> Country:…

VIEW QUESTION
Back To Top
Search