-
-
Save yasudacloud/67c1c43b55be29b9d137d3be37d9c8a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [users, setUsers] = useState<api.User[]>([]) | |
useEffect(() => { | |
const client = api.UserApiFactory(undefined, 'http://localhost:8000') | |
client.usersApiUsersGet().then(response => { | |
setUsers(response.data) | |
}) | |
}, [setUsers]) | |
return ( | |
<div className="App"> | |
<div style={{margin: 20}}> | |
<table> | |
{ | |
users.map(user => ( | |
<tr> | |
<td>{user.id}</td> | |
<td>{user.name}</td> | |
<td>{user.created}</td> | |
</tr> | |
)) | |
} | |
</table> | |
</div> | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment