assíncrono react setState
const [users, setUsers] = useState([]);
useffect(() => {
const getUsers = async () => {
let response = await fetch('/users');
let data = await response.json();
setUsers(data);
};
getUsers();
}, []);
Julio Polycarpo