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!
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.
@@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!
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
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
thanks alot for this video
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!
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.
@@programwithabu Sorry for getting back so late. Turns out - i just needed to use 'revalidate'. Everything's fine now!
@GregPeters1 Can you please share your repo for the reference and explain how this problem has resolved
@@GregPeters1 .
@@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!
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
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