mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Merge pull request #5295 from storybooks/fix/file-system-host
FIX issue where storybook wouldn't be able to navigate when hosted as a file://
This commit is contained in:
commit
b5cba23d12
@ -55,13 +55,15 @@ interface QueryLinkProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const base = document.location.pathname + '?';
|
||||
|
||||
const queryNavigate = (to: string) => {
|
||||
navigate(`?path=${to}`);
|
||||
navigate(`${base}path=${to}`);
|
||||
};
|
||||
|
||||
// A component that will navigate to a new location/path when clicked
|
||||
const QueryLink = ({ to, children, ...rest }: QueryLinkProps) => (
|
||||
<Link to={`?path=${to}`} {...rest}>
|
||||
<Link to={`${base}path=${to}`} {...rest}>
|
||||
{children}
|
||||
</Link>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user