()
| 2 | // [<img>] |
| 3 | |
| 4 | function App(){ |
| 5 | |
| 6 | const [users,setUsers] = useState([]); |
| 7 | // const [name,setName] = useState(""); |
| 8 | const [count,setCount] = useState(30); |
| 9 | |
| 10 | |
| 11 | useEffect(()=>{ |
| 12 | |
| 13 | async function GithubProfile() { |
| 14 | |
| 15 | const response = await fetch(`https://api.github.com/users?per_page=${count}`); |
| 16 | const data = await response.json(); |
| 17 | setUsers(data); |
| 18 | console.log("Hello"); |
| 19 | } |
| 20 | |
| 21 | GithubProfile(); |
| 22 | |
| 23 | },[count]) |
| 24 | |
| 25 | // function handleChange(e){ |
| 26 | // setName(e.target.value.toUpperCase()); |
| 27 | // } |
| 28 | |
| 29 | return ( |
| 30 | <> |
| 31 | <h1>Github User</h1> |
| 32 | <input type="number" value={count} onChange={(e)=>setCount(e.target.value)}></input> |
| 33 | <div style={{display:"flex", justifyContent:"center", alignItems:"center", flexWrap:"wrap" , gap:"10px"}}> |
| 34 | { |
| 35 | users.map(user=>( |
| 36 | <img src={user.avatar_url} height={"100px"} width={"100px"} key={user.login}/> |
| 37 | )) |
| 38 | } |
| 39 | </div> |
| 40 | </> |
| 41 | ) |
| 42 | } |
| 43 | |
| 44 | export default App; |
nothing calls this directly
no test coverage detected