๐Ÿ“ฆ AlessioGr / root-layout-rerender-repro

๐Ÿ“„ layout.tsx ยท 27 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { ServerActionProvider } from './ServerActionProvider';


const serverAction = async () => {
  'use server'
  console.log('Server action 3 triggered')
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  console.log('Rendering rootlayout')
  return (
    <html lang="en">
      <body
      >
        <ServerActionProvider serverAction={serverAction}>
        {children}
        </ServerActionProvider>
      </body>
    </html>
  );
}