nextJs getServerSideProps and .map()
Unanswered
Leafcutting bee posted this in #help-forum
Leafcutting beeOP
Bro. What did i do wrong ?
Im newbies
Im newbies
3 Replies
Giant panda
The response from that Dummy API isn't an array, thus
Array.map doesn't exist.Technically the dirtiest solution for now is to write
const quotes = (await res.json()).quotesAlso I'm seeing something else that is kinda related to that.
getServerSideProps doesn't exist for components, only for pages. So even if you fix it as proposed the variables quotes in the component will always be undefined.