Skip to content

Commit

Permalink
docs: 📝 update app dir demo to fix server components
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmannZ committed Aug 27, 2023
1 parent 6c0d0a7 commit 88d3c39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/with-app-router/src/app/client-side/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export default function ClientSide() {
</main>
);
}

export const dynamic = 'force-dynamic';
5 changes: 5 additions & 0 deletions examples/with-app-router/src/app/server-side/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ export default function ServerSide() {
</main>
);
}

// By default server components are statically generated at build-time. To make
// sure the env vars are actually loaded use, add the following line to server
// components that use [env]. 👇
export const dynamic = 'force-dynamic';

0 comments on commit 88d3c39

Please sign in to comment.