From e8bc91cadf591af7a8e591de0e3231561e20b402 Mon Sep 17 00:00:00 2001 From: JunichiSugiura Date: Wed, 8 Jan 2025 10:27:38 +0900 Subject: [PATCH] Fix react hook error with storybook --- packages/keychain/.storybook/main.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/keychain/.storybook/main.ts b/packages/keychain/.storybook/main.ts index 5a231b384..d544e44ab 100644 --- a/packages/keychain/.storybook/main.ts +++ b/packages/keychain/.storybook/main.ts @@ -1,5 +1,5 @@ import type { StorybookConfig } from "@storybook/react-vite"; -import { join, dirname } from "path"; +import { join, dirname, resolve } from "path"; import { mergeConfig } from "vite"; /** @@ -33,6 +33,12 @@ const config: StorybookConfig = { external: ["vite-plugin-node-polyfills/shims/global"], }, }, + resolve: { + alias: { + react: resolve(__dirname, "../node_modules/react"), + "react-dom": resolve(__dirname, "../node_modules/react-dom"), + }, + }, }); }, staticDirs: ["../public"],