Skip to content

Commit 389a26e

Browse files
committed
fix: storybook
1 parent b1ef424 commit 389a26e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.storybook/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const config: StorybookConfig = {
2727
"@/src": path.resolve(__dirname, "../src"),
2828
"@/e2e": path.resolve(__dirname, "../e2e"),
2929
"@/convex": path.resolve(__dirname, "../convex"),
30+
"convex/react": path.resolve(__dirname, "mocks/convex-react.ts"),
31+
"convex/react-clerk": path.resolve(__dirname, "mocks/convex-react.ts"),
3032
};
3133

3234
return config;

.storybook/mocks/convex-react.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Storybook用のconvex/reactモック
2+
// useMutation/useQuery/useActionを何もしないスタブに差し替える
3+
4+
export const useQuery = () => undefined;
5+
export const useMutation = () => async () => {};
6+
export const useAction = () => async () => {};
7+
export const useConvex = () => ({});
8+
export const useConvexConnectionState = () => ({ isConnected: false });
9+
export const ConvexProvider = ({ children }: { children: React.ReactNode }) => children;

0 commit comments

Comments
 (0)