When I console log locs.data I get an array, yet it says it is undefined..? Not sure what's wrong with this.
let [locs, setLocs] = useState([])
useEffect(() => {
fetch("http://localhost:3000/api/locations")
.then((res) => res.json())
.then((data) => setLocs(data))
}, [])
<Menu>
<MenuButton
px={4}
py={2}
transition="all 0.2s"
borderRadius="md"
borderWidth="1px"
as={Button}
rightIcon={<ChevronDownIcon />}>
Location Links
</MenuButton>
<MenuList>
{locs.data.map(loc => (
console.log(loc)
))}
</MenuList>
</Menu>