The fetcher. data is not bound to the components life cycle, which is very annoying sometimes. For example, when i have a dialog with a form and i want to show a toast to the user using the fetcher. data, but when the user closes then reopens the dialog then the toast is shown again. This might seem like a small problem but it hampers both the ux and the dx and i had to use tanstack query's useMutation for it. I also tried a hacky thing by calling a resource route action that returns null to reset the fetcher. data. Is there any elegant solution for this problem?
Elegant no, but you could create a custom fetcher for this with useState where you have a boolean flag that is reset on a shown notification or something like that, obviously it's a bit hard to say concretely how to handle it without the code but thats the first thing that comes to mind
Best remix content on the internet atm. Better than the remix run channel itself. Keep it up man. Greatly appreciated🎉
Thank you so much! That is really appreciated!
I learned a lot of Remix from you. Please keep posting !
Will do, thank you for watching!
Great thanks for sharing
Thank you!
Awesome!
Thank you!
The fetcher. data is not bound to the components life cycle, which is very annoying sometimes. For example, when i have a dialog with a form and i want to show a toast to the user using the fetcher. data, but when the user closes then reopens the dialog then the toast is shown again. This might seem like a small problem but it hampers both the ux and the dx and i had to use tanstack query's useMutation for it. I also tried a hacky thing by calling a resource route action that returns null to reset the fetcher. data. Is there any elegant solution for this problem?
Elegant no, but you could create a custom fetcher for this with useState where you have a boolean flag that is reset on a shown notification or something like that, obviously it's a bit hard to say concretely how to handle it without the code but thats the first thing that comes to mind
Will remix-toast solve this problem?
@@khanahmad452 it could, depending on the code he has 😅
What's coming next.
We will see 🫣