Sfoglia il codice sorgente

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

Karan Handa 6 mesi fa
parent
commit
218869cf45
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      packages/storybook/.storybook/mocks/solid-router.tsx

+ 8 - 0
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
 }