// Example from https://beta.reactjs.org/learn import React, { useState, useEffect } from "react"; import styles from './collaborators.module.css' function Collaborators() { const [books, setBooks] = useState(null); useEffect(() => { getData(); async function getData() { try { const response = await fetch( "https://api.github.com/repos/kalanakt/All-Url-Uploader/contributors" ); const data = await response.json(); setBooks(data); } catch (error) { console.log(error); } } }, []); return (
{books? (
{books.map((book: { [x: string]: any; commit: { message: string; author: { date: string; }; verification: { verified: string | number | boolean | React.ReactElement> | React.ReactFragment | React.ReactPortal; }; }; html_url: string; comments_url: string; author: { [x: string]: string; login: string; avatar_url: string; }; }, index: React.Key) => { return (
{book.login}
); })}
+
) : (
404 Page Not Found.
)}
) } export default function MyApp() { return }