Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout is re-rendered when server action is called #66961

Open
festusyuma opened this issue Jun 17, 2024 · 0 comments
Open

Layout is re-rendered when server action is called #66961

festusyuma opened this issue Jun 17, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application. Developer Experience Issues related to Next.js logs, Error overlay, etc. Performance Anything with regards to Next.js performance.

Comments

@festusyuma
Copy link

Link to the code that reproduces this issue

https://github.com/festusyuma/next-issue-test

To Reproduce

  1. start application in dev mode

  2. navigate to url

  3. click on the next buttom

  4. log on layout will be printed for almost every click to indicate the layout was rendered again on the server

  5. checkout to react-hook-form and repeat steps 1 - 4, same thing will happen when using react-hook-form

  6. checkout to react-hook-form-api and repeat 1-4, this will not re-render the layout when calling external api

https://photos.app.goo.gl/L2faEJPxTYDUibeBA (video sample)

Current vs. Expected behavior

Expected behaviour: Layout should not be re-rendered when server action is called
Current behaviour: Layout is re-rendered when server action is called. this happens even when you have children and grandchildren layout. it is re-rendered from top to bottom

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.0.0: Thu May 30 21:30:12 PDT 2024; root:xnu-11215.0.31.511.2~1/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.11.1
  npm: 10.2.4
  Yarn: 1.22.21
  pnpm: 8.15.8
Relevant Packages:
  next: 14.2.4 // Latest available version is detected (14.2.4).
  eslint-config-next: 14.2.4
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

create-next-app, Developer Experience, Performance

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), Other (Deployed)

Additional context

No response

@festusyuma festusyuma added the bug Issue was opened via the bug report template. label Jun 17, 2024
@github-actions github-actions bot added create-next-app Related to our CLI tool for quickly starting a new Next.js application. Developer Experience Issues related to Next.js logs, Error overlay, etc. Performance Anything with regards to Next.js performance. labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application. Developer Experience Issues related to Next.js logs, Error overlay, etc. Performance Anything with regards to Next.js performance.
Projects
None yet
Development

No branches or pull requests

1 participant