()
| 13 | |
| 14 | useEffect(() => { |
| 15 | const fetchData = async () => { |
| 16 | try { |
| 17 | setLoading(true); |
| 18 | const response = await axios.get( |
| 19 | "https://api.github.com/repos/devs-in-tech/DevsInTech/contributors" |
| 20 | ); |
| 21 | const data = response.data; |
| 22 | setContributors(data); |
| 23 | setLoading(false); |
| 24 | } catch (error) { |
| 25 | console.error(error); |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | fetchData(); |
| 30 | }, []); |