MCPcopy Create free account
hub / github.com/CodeWithHarry/Sigma-Web-Dev-Course / fetchData

Function fetchData

Video 113/src/App.jsx:8–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 const [cards, setCards] = useState([])
7
8 const fetchData = async () => {
9 let a = await fetch("https://jsonplaceholder.typicode.com/posts")
10 let data = await a.json()
11 setCards(data)
12 console.log(data)
13 }
14
15 useEffect(() => {
16 fetchData()

Callers 1

AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected