How to use the @storybook/router.queryFromLocation function in @storybook/router

To help you get started, we’ve selected a few @storybook/router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storybookjs / storybook / lib / api / src / modules / url.ts View on Github external
const initialUrlSupport = ({ navigate, state: { location, path, viewMode, storyId } }: Module) => {
  const addition: Additions = {};
  const query = queryFromLocation(location);
  let selectedPanel;

  const {
    full,
    panel,
    nav,
    addons,
    panelRight,
    stories,
    addonPanel,
    selectedKind,
    selectedStory,
    path: queryPath,
    ...customQueryParams
  } = query;