diff --git a/sandpack-react/src/contexts/utils/useClient.ts b/sandpack-react/src/contexts/utils/useClient.ts index 414c4dd4..13c70272 100644 --- a/sandpack-react/src/contexts/utils/useClient.ts +++ b/sandpack-react/src/contexts/utils/useClient.ts @@ -19,10 +19,7 @@ import type { SandpackStatus, } from "../.."; import { generateRandomId } from "../../utils/stringUtils"; -import { - MAX_SANDPACK_ID_LENGTH, - useAsyncSandpackId, -} from "../../utils/useAsyncSandpackId"; +import { useAsyncSandpackId } from "../../utils/useAsyncSandpackId"; import type { FilesState } from "./useFiles"; diff --git a/sandpack-react/src/utils/useAsyncSandpackId.ts b/sandpack-react/src/utils/useAsyncSandpackId.ts index 3bd42b40..312bb281 100644 --- a/sandpack-react/src/utils/useAsyncSandpackId.ts +++ b/sandpack-react/src/utils/useAsyncSandpackId.ts @@ -17,7 +17,7 @@ export const useSandpackId = () => { * For example, this id will be used to mount SW in the iframe * so, to keep the URL valid, this must be an 9 character long string */ -export const MAX_SANDPACK_ID_LENGTH = 9; +const MAX_ID_LENGTH = 9; export const useAsyncSandpackId = (files: SandpackBundlerFiles) => { if (typeof useReactId === "function") { @@ -31,11 +31,11 @@ export const useAsyncSandpackId = (files: SandpackBundlerFiles) => { return ensureLength( sha.replace(/:/g, "sp").replace(/[^a-zA-Z]/g, ""), - MAX_SANDPACK_ID_LENGTH + MAX_ID_LENGTH ); }; } else { - return () => ensureLength(generateRandomId(), MAX_SANDPACK_ID_LENGTH); + return () => ensureLength(generateRandomId(), MAX_ID_LENGTH); } };