From ab01d11f313b1fee8f6f194c39acba66761a0c10 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 23 Jun 2025 12:57:35 +0800 Subject: [PATCH] . --- apps/blogai/app/[locale]/morphic/action.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/blogai/app/[locale]/morphic/action.tsx b/apps/blogai/app/[locale]/morphic/action.tsx index 3ac6e60..7cda0f9 100644 --- a/apps/blogai/app/[locale]/morphic/action.tsx +++ b/apps/blogai/app/[locale]/morphic/action.tsx @@ -123,15 +123,20 @@ const initialUIState: { // initialAIState // }) -export const { - AIProvider, - useUIState, - useAIState, - useActions -} = createAI({ +// ✅ 第一步:先创建 AI +const AI = createAI({ actions: { submit }, initialUIState, initialAIState }) +// ✅ 第二步:解构出 Provider 和 hooks +export const { + AIProvider, + useUIState, + useAIState, + useActions +} = AI + +// ✅ 第三步:导出 AI 给 getMutableAIState 用 export { AI } \ No newline at end of file