Skip to content
Advertisement

Next.js, Strapi – Fetch response is empty

I have nextjs frontend that fetch data from strapi backend. Problem is that data is empty even if i can see on strapi dev logs that request has been made.

This is next.js code

JavaScript

And here is the strapi log

JavaScript

But I don’t know why is data empty. Truth is that the response consist of base64 long text but I am not sure if that can cause the problem. Thanks in advance for any help.

Advertisement

Answer

JavaScript

You can use useState hook for React state.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement