From 9e0cfc21187d22f380017fab5011487346e58c21 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Sat, 9 Mar 2024 10:48:40 +0900 Subject: [PATCH] chore(examples): add getContext in 05_actions (#584) --- examples/05_actions/src/components/funcs.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/05_actions/src/components/funcs.ts b/examples/05_actions/src/components/funcs.ts index feda3193b..11d98eaa6 100644 --- a/examples/05_actions/src/components/funcs.ts +++ b/examples/05_actions/src/components/funcs.ts @@ -1,8 +1,11 @@ 'use server'; -import { rerender } from 'waku/server'; +import { rerender, getContext } from 'waku/server'; -export const greet = (name: string) => `Hello ${name} from server!`; +export const greet = (name: string) => { + console.log('RSC Context:', getContext()); // ---> {} + return `Hello ${name} from server!`; +}; // module state on server let counter = 0;