Best use case of the react transition mechanism... I really love this... Thank you a lot.🎉🎉
@RyanToronto5 ай бұрын
Thank you! Glad you enjoyed it!
@erikplachta5 ай бұрын
Appreciate the video. Nice to see startTransition solving some real world problems.
@RyanToronto5 ай бұрын
Thanks Erik!
@stevebendersky2056Ай бұрын
Really nice, didn't know that and really useful.
@RyanTorontoАй бұрын
Thanks you! Glad you enjoyed it
@haydenpitout51515 ай бұрын
Thanks Ryan ... great work as always 👍
@RyanToronto5 ай бұрын
Thanks!
@talhaibnemahmud5 ай бұрын
Really good video
@RyanToronto5 ай бұрын
Thanks!
@mehrabmahmudpur69845 ай бұрын
Great video. Thank's a lot.
@RyanToronto5 ай бұрын
Glad you liked it!
@bideshbanerjee55065 ай бұрын
Hello Ryan you are the only one who talks deep about RSC. I just want to know one thing that suppose for a particular page there are 4 - 5 components and an user changes or updates something in a component with server action then the whole json representation of every component of that page will get send by the server, is that how it works ?? and if it is, how optimal is that approach or it works differently ?? I know it's lot to ask...but will appreciate a video or response Thank you ❤
@RyanToronto4 ай бұрын
Thank you! To answer your question it really depends on the framework you are using and how your app and action is setup. If you're using Next.js with server actions you'll most likely want to call the built-in `revalidate()` function to update any components on the page.
@oscarljimenez57175 ай бұрын
Great video like always :) One question. What's the standard for showing clean errors on the console? Using a logger like "pino"? But then i can't throw an error that my error boundary can catch :/
@RyanToronto5 ай бұрын
Thanks, glad you enjoyed it! Yah I think pino is great for logging. That said I'd still throw the error and have the error boundary catch it, but maybe also use pino right before you throw the error.
@nick-ui5 ай бұрын
Very unique solution with startTransition, how did you understand that it is necessary to use it
@erikplachta5 ай бұрын
The refresh wasn’t happening because reset was executed before refresh had time to complete. - Router.Refresh is refreshing the connection to the server. - Reset restarts the component. No async option on refresh.
@RyanToronto5 ай бұрын
Exactly what @erikplachta said! Since you want refresh and reset to happen at the same time they both need to be wrapped in a transition.
@tauhid97k4 ай бұрын
Thanks. Can you make a video on setting cookies from a separate backend in the next.js server action? So, When I use server action and set credentials: "include" it doesn't work. This is because it's happening on the server. How can I forward the cookies in the browser to that separate API/backend server from server action?
@RyanToronto4 ай бұрын
Great question. You can use Next's built in cookies() function to read the cookies in your server action and then pass them into the fetch request your action is making to your backend.
@tauhid97k4 ай бұрын
@@RyanToronto I've tried this and several other methods but it's not consistent or maybe I don't quite understand the situation here. From the client side credentials: "include" works as expected. So I thought with your amazing explanation I could understand better. But Thanks. I'll keep trying.
@bojanraguz369Ай бұрын
What to do in a case when the user clicks on a route "/throws-sometimes" that's included in navbar? Can the error be reset via clicking on a link to the route within navbar? e.g. Throws sometimes
@RyanTorontoАй бұрын
I haven't tried it, but I wonder if it just works? If not, my first thought was you'd have to somehow get the reset into the nav bar so the error could be dismissed. Let me know what you come up with, I'd be very interested to know how you went about solving this type of problem.
@bojanraguz369Ай бұрын
@@RyanToronto Yeah, it's not working. I gonna try, if I'll make it I'll let you know :) Thanks
@TfMukles5 ай бұрын
make a video on refresh token in nextjs. I am facing the issues. In nextjs layout and page is stream simultaneously can you please make a video.
@RyanToronto5 ай бұрын
Hey there, would love to! Do you have an example app, mockups, or any code you can share so I can better understand the app and problem?
@luisllaboj3 ай бұрын
What would happen if wrap a transition in a transition? The outer transition holds a state for the inner transition or are they batched together or “unwrapped” like it was a promise passed to a promise constructor? lol idk if that makes sense
@RyanToronto3 ай бұрын
Great question! Transitions that wrap transitions are very common and I think saying they are "batched" is the right way of thinking about it. If a transition is inside another transition then neither state update will apply until they are both ready. In other words the state updates happen at the same time for all nested transitions.
@luisllaboj3 ай бұрын
@@RyanToronto cool, yea that makes sense, thanks!
@luisllaboj5 ай бұрын
Is router.refresh() by default wrapped in a transition under the hood? Is that why reset() executes first? So, is Router.refresh() considered an asynchronous while reset() remains sync, unless we put both together in a transition and we force both to be completed before continuing?
@RyanToronto5 ай бұрын
Yup, router.refresh uses a transition under the hood. We need to put both the reset and the router.refresh in the transition so React knows to not reset until the refresh is complete. We're telling React we'd like to transition to a state where the router is refreshed and the error boundary is reset. React won't apply the state update until those two things are ready. Another way of saying this: Putting them inside the transition tells React that they need to happen together.
@0xtz_5 ай бұрын
we have an issue in some pages we have a conditional display based on the url query and we need on each query change to reload to get the updated data 😢 any idea please hmmm even with parallel routes I need to noStore() to revalidate the data eeeeeh
@RyanToronto5 ай бұрын
Sorry to hear about your issue. Do you have an example app or demo of your app anywhere?
@0xtz_5 ай бұрын
@@RyanToronto it's a private code that I can't share but it's a server component takes an id in the query and display the needed component I can provide a basic example of you have a discord or something hhh