Skip to content
Snippets Groups Projects
Unverified Commit e426b1a3 authored by Uladzimir Havenchyk's avatar Uladzimir Havenchyk Committed by GitHub
Browse files

make local cypress dx great again (#46839)

parent 76cb82a0
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@ import { CacheProvider } from "@emotion/react";
import type { ReactNode } from "react";
import { useMemo } from "react";
import { isCypressActive } from "metabase/env";
interface EmotionCacheProviderProps {
children?: ReactNode;
}
......@@ -11,7 +13,11 @@ export const EmotionCacheProvider = ({
children,
}: EmotionCacheProviderProps) => {
const emotionCache = useMemo(() => {
const cache = createCache({ key: "emotion", nonce: window.MetabaseNonce });
const cache = createCache({
key: "emotion",
nonce: window.MetabaseNonce,
...(isCypressActive && { speedy: true }),
});
// This disables :first-child not working in SSR warnings
// Source: https://github.com/emotion-js/emotion/issues/1105#issuecomment-557726922
cache.compat = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment