Skip to content

The open source coding agent.

TypeScript

fix(storybook): restore build by mocking useLocation (#16472)

Karan Handa218869cf45b5
diff --git a/packages/storybook/.storybook/mocks/solid-router.tsx b/packages/storybook/.storybook/mocks/solid-router.tsx
index 872c17ffe45..c1bda30f4bd 100644
--- a/packages/storybook/.storybook/mocks/solid-router.tsx
+++ b/packages/storybook/.storybook/mocks/solid-router.tsx
@@ -11,6 +11,14 @@ export function useNavigate() {
return () => undefined
}
+export function useLocation() {
+ return {
+ pathname: "/story/session/story-session",
+ search: "",
+ hash: "",
+ }
+}
+
export function MemoryRouter(props: ParentProps) {
return props.children
}