How to use the react-cosmos-shared2/url.stringifyRendererUrlQuery function in react-cosmos-shared2

To help you get started, we’ve selected a few react-cosmos-shared2 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 react-cosmos / react-cosmos / packages / react-cosmos / src / getFixtureUrls.ts View on Github external
function createFixtureUrl(
  host: string,
  fixtureId: FixtureId,
  fullScreen: boolean
) {
  if (fullScreen) {
    const query = stringifyRendererUrlQuery({ _fixtureId: fixtureId });
    return `${host}/${RENDERER_FILENAME}?${query}`;
  }

  const query = stringifyPlaygroundUrlQuery({ fixtureId });
  return `${host}/?${query}`;
}
github react-cosmos / react-cosmos / packages / react-cosmos-playground2 / src / plugins / FullScreenButton / index.tsx View on Github external
const onSelect = React.useCallback(() => {
      const query = stringifyRendererUrlQuery({ _fixtureId: fixtureId });
      const fixtureUrl = `${rendererUrl}?${query}`;
      window.open(fixtureUrl, '_blank');
    }, [fixtureId, rendererUrl]);