my question is in order to do reset we are moving server side page to client side which will affect seo so how to do the same without doing page.tsx file to useclient so that we get server sdie benefits also and this error.tsx reset benefit also.
You actually dont need to make your page a client component. I had to create a reload function with startTransition and router.refresh as const reload = () => { startTransition(() => { router.refresh(); reset && reset(); }); }; to use in place of the reset()
am i the only one having the problem that the reset ist not working as is should in the example it will rerender the body but never reset the value from the const random so the error stays forever until browser refresh?
Very nice explanation Sir. if on this page.tsx, I use async operation to get dynamic title. I have export generateMetadata, I cannot "use client" due to handle error! how to resolve this?
If I use generateMetada for asnyc title, I cannot "use client" on page.jsx. How to resolve this? Very nice tutorial
my question is in order to do reset we are moving server side page to client side which will affect seo so how to do the same without doing page.tsx file to useclient
so that we get server sdie benefits also and this error.tsx reset benefit also.
I have this same question
You actually dont need to make your page a client component.
I had to create a reload function with startTransition and router.refresh as
const reload = () => {
startTransition(() => {
router.refresh();
reset && reset();
});
};
to use in place of the reset()
am i the only one having the problem that the reset ist not working as is should in the example it will rerender the body but never reset the value from the const random so the error stays forever until browser refresh?
fixed it myself i missed the step to setup "use client" on page.tsx aswell
Great
GoodJob!
Why does the void function reset refresh the component to try again?
it is a inbuilt function to handle error, it re renders the component with error and if the content loaded successfully, error is gone
🙏👍
Very nice explanation Sir. if on this page.tsx, I use async operation to get dynamic title. I have export generateMetadata, I cannot "use client" due to handle error! how to resolve this?
You don't need to do "use client"; on the page to ensure recovery.
I couldn't get mine to work until I added "use client" to the page.tsx file.
onClick must run in the browser.
This is not true. I couldn't get mine to work at all without the ''use client."
I had to write "use client" to make it work as tolbydamit mentionned to make it work