In part 3 of our series, let's finish building out our home page. We will finish up our Hero Section, then move to our Features Section, and finally add our Top Navigation and Footer.
The logoText.text outputs just fine, only ctaButton has this issues. I doubled check the created component in Strapi to make sure it’s using the same model as logoText but can’t find what’s wrong?
Thanks for the work you’ve done working on this blog posts !
I have a question regarding the flattenAttributes helper.
Is there a way to properly type it using the types generated by the strapi typescript command ?
I have been reading : Improve Your Frontend Experience With Strapi Types And TypeScript that provide a way to type strapi responses (e.g: with APIResponseCollection<"api::post.post">) and I try to find a way to use it to generically type the flattenAttributes helper.
At the moment, there isn’t a straightforward solution, at least at my level of TS understanding. Know that in v5, we are going to be getting back the simplified response, so there will be no need for the flattentAttribute function that I am using.
I used it in this tutorial because when Strapi 5 was out, I wanted to have an easier time migrating the project. Ince the response will mainly mimic what the flattenAttributes function returns.
Once Strapi 5 is released, we’ll be working on an SDK that will significantly simplify the process of using Strapi types. This development will make our work with Strapi even more straightforward and user-friendly, enhancing our overall development experience.
I have the same code and data is populated in the Strapi. I guess something went wrong at the Strapi side and it’s not got recorded in to the database. I can try to remove the header model and its data nad start over.
Hi Paul , Thank you very much vor this real-ife project . I treally helps understanding the use of Strapi in Next.js . I am struggling with a Readt hydration error . I believe I followed all of your steps but I am receiving this error
return (
<Image
src={imageUrl ?? imageFallback}
alt={alt}
height={height}
width={width}
className={className}
/>
);
}
Can you please help me with this ?