Bonjour,

Je reçois ce msg d'erreur : Network Error

AxiosError: Network Error
at XMLHttpRequest.handleError (http://localhost:3000/static/js/bundle.js:41055:14)

Avez vous une idée ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import './App.css';
 
 
function App() {
  const [coins, setCoins] = useState([]);
 
  useEffect(() => {
    axios
      .get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=100&page=1&sparkline=false')
      .then(res => {
        setCoins(res.data);
        console.log(res.data);
      });
  });
 
  return (
    <div className="App">
      <h1>APIIII</h1>
    </div>
  );
}
 
export default App;