PART 2 - Introduction to Next.js | Build a Blog Website with Sanity Backend

Поділитися
Вставка
  • Опубліковано 5 лис 2024

КОМЕНТАРІ • 10

  • @ahmedabdelmeguid1131
    @ahmedabdelmeguid1131 9 місяців тому

    thanks alot for this video

  • @GregPeters1
    @GregPeters1 10 місяців тому

    Sir, great Sanity/Next Js project! Question for you - when i update my posts in the deployed Sanity studio, the changes do not show in on my local:3000 frontend. Can I preview my changes? Thanks!

    • @programwithabu
      @programwithabu  10 місяців тому +1

      Great question.
      Can you get these posts in production?
      I ask because the way the sanity client (createClient) is setup is in away that it does not specify development or production.
      So I would advice you to check your client on nextjs if everything is setup ok, and also check the function that gets all the posts if that is also setup.
      If all these are ok, then also check the component that’s calling the function returning all the posts.
      Lemme know if it works.

    • @GregPeters1
      @GregPeters1 8 місяців тому

      @@programwithabu Sorry for getting back so late. Turns out - i just needed to use 'revalidate'. Everything's fine now!

    • @rahichauhan4655
      @rahichauhan4655 8 місяців тому +1

      @GregPeters1 Can you please share your repo for the reference and explain how this problem has resolved

    • @rahichauhan4655
      @rahichauhan4655 8 місяців тому

      @@GregPeters1 .

    • @GregPeters1
      @GregPeters1 7 місяців тому

      @@rahichauhan4655 I didn't create a repository. But, the issue is dynamic, and regardless of which CMS you're using, a thorough understanding of how Next JS/Vercel's tag works is needed. I say this because i spent half a day reading issues on github regarding this subject. As it turns out, chances are that you'll get unreliable results if you're using revalidating on multiple pages. The best advice i can give you is to visit Vercel's yt channel, look for the 25min vid posted on Jan 15, '24 titled: Next.js App Router Caching: Explained!

  • @MeshackOdunowe
    @MeshackOdunowe 9 місяців тому

    thank you so much for this. I have a little question>>>>
    i don't want the id of the post to be the url. i want the slug generated to be the url . any idea on how i can make that happen?. i'll be glad to get a reply

    • @programwithabu
      @programwithabu  8 місяців тому

      The idea here is to use the useSearchParams hook to target the URL and change it according to the query
      Find more informations on the link below
      nextjs.org/docs/app/api-reference/functions/use-search-params