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

Setting a state but still getting error when trying to use after it – Reactjs

I'm trying to get pinned article const getCurrentlyPinned = async() =>{ setLoader(true) await firestore() .collection('admin_control') .doc('currently_Pinned') .get() .then(snapshot =>{ const data = snapshot.data(); setpinnedNewsID(data.pinnedNewsId) }) } useEffect(() => { getCurrentlyPinned().then(()=>{ console.log(pinnedNewsID) }) }, []) therefore calling it from useEffect and…

VIEW QUESTION

React navigation params object empty – React native

When i try passing the params to my review screen it comes up undefined. I'm using "@react-navigation/native": "^6.1.3" and "@react-navigation/stack": "^6.3.12" App.js import 'react-native-gesture-handler'; import { StyleSheet, Text, View, Button, TouchableOpacity, FlatList } from 'react-native'; import {NavigationContainer} from '@react-navigation/native'; import…

VIEW QUESTION
Back To Top
Search