Skip to content

Commit 88ac73a

Browse files
committed
Remove @emotion/cache usage from EuiProvider in favor of the default cache Emotion provides
- which will automatically set compat = true
1 parent 41e4ac5 commit 88ac73a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/components/provider/__snapshots__/provider.test.tsx.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ exports[`EuiProvider applying modifications propagates \`modify\` 1`] = `
2020
"key": "css",
2121
"nonce": undefined,
2222
"prepend": undefined,
23+
"speedy": [Function],
2324
"tags": Array [],
2425
},
2526
}
@@ -379,6 +380,7 @@ exports[`EuiProvider changing color modes propagates \`colorMode\` 1`] = `
379380
"key": "css",
380381
"nonce": undefined,
381382
"prepend": undefined,
383+
"speedy": [Function],
382384
"tags": Array [],
383385
},
384386
}
@@ -727,6 +729,7 @@ exports[`EuiProvider is rendered 1`] = `
727729
"key": "css",
728730
"nonce": undefined,
729731
"prepend": undefined,
732+
"speedy": [Function],
730733
"tags": Array [],
731734
},
732735
}
@@ -1814,6 +1817,7 @@ exports[`EuiProvider providing an @emotion cache config applies the cache to glo
18141817
"key": "css",
18151818
"nonce": undefined,
18161819
"prepend": undefined,
1820+
"speedy": [Function],
18171821
"tags": Array [],
18181822
},
18191823
}
@@ -2184,6 +2188,7 @@ exports[`EuiProvider providing an @emotion cache config applies the cache to uti
21842188
"key": "css",
21852189
"nonce": undefined,
21862190
"prepend": undefined,
2191+
"speedy": [Function],
21872192
"tags": Array [],
21882193
},
21892194
}
@@ -2554,6 +2559,7 @@ exports[`EuiProvider providing an @emotion cache config provides a default cache
25542559
"key": "css",
25552560
"nonce": undefined,
25562561
"prepend": undefined,
2562+
"speedy": [Function],
25572563
"tags": Array [],
25582564
},
25592565
}
@@ -2901,6 +2907,7 @@ exports[`EuiProvider using \`null\` theme option does not add global styles 1`]
29012907
"key": "css",
29022908
"nonce": undefined,
29032909
"prepend": undefined,
2910+
"speedy": [Function],
29042911
"tags": Array [],
29052912
},
29062913
}

src/components/provider/provider.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import React, { PropsWithChildren } from 'react';
10-
import createCache from '@emotion/cache';
10+
import { cache as fallbackCache } from '@emotion/css';
1111
import { EmotionCache } from '@emotion/react';
1212

1313
import {
@@ -28,9 +28,6 @@ const isEmotionCacheObject = (
2828
obj: EmotionCache | Object
2929
): obj is EmotionCache => obj.hasOwnProperty('key');
3030

31-
const fallbackCache = createCache({ key: 'css' });
32-
fallbackCache.compat = true;
33-
3431
export interface EuiProviderProps<T>
3532
extends Omit<EuiThemeProviderProps<T>, 'children' | 'theme'>,
3633
EuiGlobalStylesProps {

0 commit comments

Comments
 (0)