2021-12-20
3652
#react
Ovie Okeh
11051
Dec 20, 2021 â‹… 13 min read

Using Contentful with React

Ovie Okeh Programming enthusiast, lover of all things that go beep.

Recent posts:

Exploring The Aha Stack: Astro, Htmx, Alpine — A Complete Tutorial With A Demo Project And Comparison To Other Stacks

Exploring the AHA stack: Tutorial, demo, and comparison

The AHA stack — Astro, htmx, and Alpine — is a solid web development stack for smaller apps that emphasize frontend speed and SEO.

Oyinkansola Awosan
May 3, 2024 â‹… 13 min read
Comparing Hattip Vs Express Js For Modern Application Development

Comparing Hattip vs. Express.js for modern app development

Explore what Hattip is, how it works, its benefits and key features, and the differences between Hattip and Express.js.

Antonello Zanini
May 2, 2024 â‹… 8 min read
Using React Shepherd To Build A Site Tour

Using React Shepherd to build a site tour

React Shepherd stands out as a site tour library due to its elegant UI and out-of-the-box, easy-to-use React Context implementation.

Onuorah Bonaventure
May 1, 2024 â‹… 14 min read
A Guide To Cookies In Next Js

A guide to cookies in Next.js

Cookies are crucial to web development. This article will explore how to handle cookies in your Next.js applications.

Georgey V B
Apr 30, 2024 â‹… 10 min read
View all posts

4 Replies to "Using Contentful with React"

  1. Noob question: Does a developer need a CMS? I didn’t think about one, but then I realized that managing a hundred posts, which each post having on average 5 iages, becomes quite painful.

  2. Hi Ovie, I’ve followed your tutorial however when the user clicks on an individual post the SinglePost component renders in an endless loop. Any ideas? Cheers.

  3. Anyone stumbling upon this article and getting infinite loops in the Network tab you need to change the useEffect slightly:

    export default function useSinglePost(slug) {
    const [post, setPost] = useState(null);
    const [isLoading, setLoading] = useState(true);
    useEffect(() => {
    getSinglePost(slug)
    .then(result => {
    setPost(result[0].fields);
    setLoading(false);
    });
    }, [slug]);
    return [post, isLoading];
    }

Leave a Reply