I created an issue already on Github https://github.com/vercel/next.js/issues/66961 but thought ask here too
when I do a router.push() after a server action is called, it causes the layout to be re-rendered. if I replace the server action call with a regular api call, this does not cause the layout to re-render
here's a video showing exactly what's going on https://github.com/festusyuma/next-issue-test
here's a sample repo with different branches for the different use cases
- main => uses useFormState with server action (re-renders layout)
- react-hook-form => calls server action in submit handler (re-renders layout)
- react-hook-form-api => calls external api in submit handler (works as expected)
Thanks
GitHub
Link to the code that reproduces this issue https://github.com/festusyuma/next-issue-test To Reproduce start application in dev mode navigate to url click on the next buttom log on layout will be p...