From the course: The Freelance Stack: Real Project with Next.js and Strapi

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Render articles from Strapi data on main page of the blog

Render articles from Strapi data on main page of the blog - Next.js Tutorial

From the course: The Freelance Stack: Real Project with Next.js and Strapi

Render articles from Strapi data on main page of the blog

So we now have our data available here, which means we can actually get rid of both of these arrays right here, because what we're going to be using is our data itself. The thing is though, that we need the featured items and we need the highlight article data, which will be a little bit different from each other. Now what I'm going to be doing here for now is sort of more like a quick fix, or not a quick fix, it's pretty robust, but it will get into trouble when we have like 100 articles published on Strapi or something like that because what I'm going to do now is I'm going to say I want to have my found highlight article to be from my data and I want to find it in there. Now what is the problem with that? The problem with that is that this is all happening on the front end so my back end basically sends all the articles to the front end and in the front end I'm just going to look for the one highlight article that I found. The problem here is that if we, for example, later on use…

Contents