Am really glad I clicked this video, at first I thought i have to state management for all this stuff but you make it really simple and awesome and exactly same what I want to make. Thnx a lot
@hamedbahram4 ай бұрын
Glad it was helpful!
@Kai-cz7wf4 ай бұрын
@@hamedbahram there is a problem i found, I also have some button on the page redirecting to another page but they all came back ('/movies") whenever I click them, Is there any solution??
@MranZupljanin11 ай бұрын
what a hidden gem of a channel, ur explanations are magnificent.. great job
@hamedbahram11 ай бұрын
Thanks! glad you think so!
@eshw23 Жыл бұрын
Dude I cant believe youtube didnt recommend your channel to me wow glad I found it, was looking for more basic technical videos on concepts we need to master instead of 5 hour long project tutorials. These helps me work on my own projects
@hamedbahram Жыл бұрын
Glad to hear that! Welcome to the channel. I appreciate your comment.
@heysahilsingh8 ай бұрын
Same feeling ❤
@ogbillity Жыл бұрын
Excellent tutorial. Thank you so much.
@hamedbahram Жыл бұрын
Glad it was helpful Peter!
@darawan_omar4 ай бұрын
I don't know what to say or describe you. You are always the best ❤❤
@hamedbahram4 ай бұрын
Thank you so much 😀
@eliuddyn Жыл бұрын
Amazing Tutorial 🔥🔥
@hamedbahram Жыл бұрын
Thanks 🔥
@benjimosso3 ай бұрын
Man, you are amazing! Thank you so much!!
@hamedbahram3 ай бұрын
You're welcome! Glad it helped.
@mariocesena22775 ай бұрын
Awesome tutorial! 👌🏼👌🏼
@hamedbahram5 ай бұрын
Thank you 🙌
@juanferrer5885 Жыл бұрын
Awesome tutorial. A tutorial of testing in App router would be great
@hamedbahram Жыл бұрын
Thank you! Great suggestion by the way.
@peteronyegbule72074 ай бұрын
you saved me from 4 days of no success thank you so much
@hamedbahram4 ай бұрын
Glad I could help
@rishuscript6 ай бұрын
Underrated channel 😢 Lots of love to your channel ❤
@hamedbahram6 ай бұрын
Thank you! I appreciate that!
@movietime84033 ай бұрын
Thank you :), it was really useful you saved me from the bugs which i have been working on 2 days.
@hamedbahram3 ай бұрын
Glad it helped!
@bhuvicodes6 ай бұрын
What a great tutorial ❤
@hamedbahram6 ай бұрын
Glad you think so!
@user-ck8vg9bd6v4 ай бұрын
thank you brother for that video
@hamedbahram4 ай бұрын
My pleasure!
@mamunahmed8113 Жыл бұрын
Big fan from Bangladesh❤❤❤
@hamedbahram Жыл бұрын
Welcome to the channel!
@mousaahmed66896 ай бұрын
absolutely magnificent
@hamedbahram6 ай бұрын
Appreciate it!
@jordanrodrigues182411 ай бұрын
Superb!
@hamedbahram11 ай бұрын
Thank you! Cheers!
@pamcls3 ай бұрын
Amazing content, as always. You're the man!!!👏 Now, I have a problem with this approach, dunno, if you can help: Since you know Prismic, I'll expose the real scenario: I have a dynamic Page server component (let's say: [page]) and I have multiple slices in it. One of them it's an `ArticleCategory` slice (server component) that fetches a list of articles of a specific category and in that slice, as child component, I have a client component that handles the searchTerm. All fine and using the same example you're showing in the video, however, I get a 500 error when accessing a page with that slice because I am using generateStaticParams on that `Page` component to get all the documents from Prismic. The error is known: "Static to Dynamic Error" and there's a fix for regular scenarios, advised by nextjs, just turn your page into dynamic (If I remove the `generateStaticParams`) it works but that defeats the whole purpose of having static regeneration. I know this is farfetched but maybe you've a solution for this 🙏😅 Thanks in advance for your help
@hamedbahram3 ай бұрын
Thank you! I've had a similar problem before with the static generation and deleting the `.next` folder and restarting the dev server or rebuilding the project solves the problem most of the time. But beyond that I'm not sure what specifically might cause this error in your implementation.
@user-ny9em7sy7f8 ай бұрын
Followed your steps,everything working excepts useEffect in searchBar component, on refresh page={number} is deleted
@hamedbahram8 ай бұрын
Compare your code to mine (link in description) and see what you're doing differently.
@user-ny9em7sy7f8 ай бұрын
did it but still the same... @@hamedbahram
@ahmadnehal2 ай бұрын
In my case, it was due to React's Strict Mode that you can turn off in next.config.js.
@mohammadmalek504211 ай бұрын
Thank you ❤
@hamedbahram11 ай бұрын
Welcome!
@oluwafemifaleye6845 Жыл бұрын
Thank you so much
@hamedbahram Жыл бұрын
Anytime!
@FGA-477 ай бұрын
Thanks alot
@hamedbahram7 ай бұрын
Happy to help!
@aymenbachiri-yh2hdАй бұрын
Thanks
@hamedbahramАй бұрын
Welcome!
@zaidsameer Жыл бұрын
Thanks for the great tutorials you provided, What If I have more than one param each passing the params values to a parent (server component) page and i want to delete one of the params?
@hamedbahram Жыл бұрын
I'm not sure if I understand the question correctly. We are setting two different params here, one for the search term, and the other for the page number from different components.
@user-yq3if2mi5h9 ай бұрын
Hello Hamed! Could you please show us how to make multi category filter system in addition to pagination and search using server components with URL? Thank you in advance!
@hamedbahram9 ай бұрын
That's a good idea, I'll have that in mind. Thanks.
@UWalexs5 ай бұрын
for me, useEffect is rendered multiple times and that initial "first render" if block is bypassed and I lose the page query param upon refreshing the page. When config is set to strictMode: "false", then this logic works. Any ideas? 🤔
@hamedbahram5 ай бұрын
It shouldn't be like that, clone and compare my code to see what you're doing differently!
@ahmadnehal2 ай бұрын
In my case, it was due to React's Strict Mode that you can turn off in next.config.js.
@StephenRayner Жыл бұрын
Do a video on event driven architecture in NextJS 13 with Inngest 🎉
@hamedbahram Жыл бұрын
Thanks for the suggestion, I like that!
@adeniyitaofik38326 ай бұрын
Hello what if you have other query in the url alreay how do you remove just the search from the url query params without affecting others
@hamedbahram6 ай бұрын
Good question, you'd have to get all query parameter and only rewrite the `search`
@0xtz_11 ай бұрын
Amazing 👏, I'm using a model, I have a form to select a user by searching.... any other ideas to implement this without setting the url ? Please
@hamedbahram11 ай бұрын
You can use server actions as well, if you look at the infinite scrolling video where I use a server action to fetch data from the server but also from the client. Other than that you can use the good old client side fetching.
@0xtz_11 ай бұрын
@@hamedbahram thanks man
@hamedbahram11 ай бұрын
@@0xtz_ Anytime!
@christophercaldwell66415 ай бұрын
What would you suggest if you wanted to show a loading skeleton of movies while the search was running? It looks instant, but what if you added an artificial 2-3 second delay on getMovies? Do you know how to go about showing the static content of movies while the server waits for the movies to load?
@christophercaldwell66415 ай бұрын
I just saw your other video where you make a loading skeleton lol. Watching it now! Oops.
@hamedbahram5 ай бұрын
There you go :)
@christophercaldwell66415 ай бұрын
@@hamedbahram Great video thank you. Have you used partial prerendering? Adding the key did not solve the stale issue when PPR was enabled. Not your problem, ofc. It works just fine without PPR enabled. Wondering if you have used it at all and did the same thing in the video, just with PPR
@hamedbahram5 ай бұрын
@@christophercaldwell6641 Haven't tried it with this particular example. But I'll have a video on partial pre-rendering soon.
@christophercaldwell66415 ай бұрын
@@hamedbahram oh okay, cool. I’ve been stuck for a few days, I haven’t been able to find any solution. I tried all of the things you mentioned, router refresh, keys, etc. In my experience when you navigate, the route doesn’t change until the fresh data has been loaded and then it abruptly changes to the new stuff. Another thing of note is that this worked as expected for me in local development, but hosted on Vercel did not. I’d love to see a video on this, it’s frustrating and I’m close to using a client side data fetching pattern to get around it. Not ideal!
@aravind_k28 Жыл бұрын
Amazing tutorial ❤. But one doubt, even if you use search params as state, it will do server rendering but it won't show any loader right? And also it will take some noticable time to get the results and render them. loader.tsx file also won't help... So which method should we use client or server components? Hoping for a response... Thank you!
@hamedbahram Жыл бұрын
Thank you. You can use either one, I prefer server components, because it eliminates the need to create an API layer, also it's faster as it ships less JS to the browser, it can also benefit from NextJs cache. The loading UI is not ideal as it won't trigger since the route doesn't change.
@aravind_k28 Жыл бұрын
@@hamedbahram Thank you!
@aravind_k28 Жыл бұрын
@@hamedbahram but user won't see any feedback like loader while the data is being fetched, what can we do in that case? Isnt that a bad ux?
@hamedbahram Жыл бұрын
@@aravind_k28 Agreed! we need a loading inidcator, I'm thinking to pass the promise to await it in a suspense component... I'd have to think about this. Let me know if you could come up with a solition in the mean time.
@aravind_k28 Жыл бұрын
@@hamedbahram I tried that approach. It won't work as expected if you change query params. I also tried loading.tsx, no hope. But even if we add loading.tsx or suspense, we will loose SEO, because the crawlers will see loading icon only. Currently I don't know how to achieve the exact balance between SEO and decent UX... 🥲
@generalwill10 Жыл бұрын
I’d like to see an example like this but querying an API…anyone know of a good resource that shows that?🧐
@hamedbahram Жыл бұрын
Do you mean querying an API from a client component?
@generalwill10 Жыл бұрын
@@hamedbahram I suppose in your example yes. I’m transposing an app I made using an api from Next 13 to Next 13.4 where the App router became stable. I want to add a search bar to my app to query the api and then receive whatever they query back to them.
@hamedbahram Жыл бұрын
@@generalwill10 Ok great! and what part is stopping you?