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:

Rxjs Adoption Guide: Overview, Examples, And Alternatives

RxJS adoption guide: Overview, examples, and alternatives

Get to know RxJS features, benefits, and more to help you understand what it is, how it works, and why you should use it.

Emmanuel Odioko
Jul 26, 2024 â‹… 13 min read
Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 â‹… 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 â‹… 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 â‹… 5 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