How to clear the React Native fetch cache
I have a react native app that fetches a file from my server. When I change the file on the server, the app still displays the old data. I am debugging with expo. I have: Cleared the DNS cache with…
I have a react native app that fetches a file from my server. When I change the file on the server, the app still displays the old data. I am debugging with expo. I have: Cleared the DNS cache with…
I've created a node.JS Express server whose role is to use an API to send JSON to my front-end. I finished the back end and put it on an AWS server. Now I want to work only on the React…
I want to set stock data in stockData and print it in console when I submit form. but when I submit form, I got only undefined. I think it's because it takes time fetch data from api(not sure). How can…
I have used Params to get the url of the page that I linked to it before and it was ok to this stage, but then I can't set items accordingly. const {id} = useParams(); const [item, setItem] = useState([]);…
import React, { useState } from 'react' import './App.css' function Dog(data) { const [url, setUrl] = useState('') function fecth_data() { fetch('https://dog.ceo/api/breeds/image/random') .then((res) => res.json()) .then((data) => setUrl(data)) console.log(data) } return ( <div className="dog-main"> <img src={url} className="dog-random" alt="a dog" /> <button…
I have a React component in which I receive data. But I want to use this data in another component as well. What is the best way to do this? I don't want to use the child parent method like…
I am learning JavaScript api project, fetch, then, catch . I coded along with a YouTube JavaScript api project. Every time I try it, 'catch' is not working. let searchBtn=document.getElementById("search-btn"); let countryInp=document.getElementById("country-inp"); searchBtn.addEventListener("click", ()=>{ let countryName=countryInp.value; let finalURL=`https://restcountries.com/v3.1/name/${countryName}?fullText=true`; console.log(finalURL); fetch(finalURL)…
Im trying to do a fetch request to an open API: https://www.tenderned.nl/papi/tenderned-rs-tns/v2/publicaties/298340/documenten, but when i try this, i get the following error that CORS is blocking my fetch: Ive already tried the following fixes found on the internet: Adding an…
I am a next.js developer. I have a blog and want to search a keyword in title of my posts. this is part of my code. const [result, setresult] = useState([]); const [keyword, setkeyword] = useState(url.keyword ? `&keyword=${url.keyword}` : "");…
After creating a new to do item in the list, after clicking the delete button all of the new tasks are deleted insetead the single one. I'm expecting to be deleted only the propriete one with a passed id with…