Better test for isStorybook

This commit is contained in:
Joseph Garrone 2024-02-12 23:42:31 +01:00
parent 99bfd7379b
commit d80a583979

View File

@ -1,3 +1 @@
import { BASE_URL } from "./BASE_URL";
export const isStorybook = BASE_URL.startsWith(".");
export const isStorybook = Object.keys(window).find(key => key.startsWith("__STORYBOOK")) !== undefined;