I\'m having some issues understanding why I\'m getting a compile warning on this piece of my react code
fetch(\'/users\')
.then(res => res.json())
If you don't need to mutate the array and just do the console.log() you can do data.forEach() instead. It shouldn't give you the warning. Map expects you to return a value after you've transformed the array.
fetch('/users')
.then(res => res.json())
.then(data => {
data.forEach(users => {
console.log(users);
});
});