Skip to content

Commit

Permalink
Remove @emotion/cache usage from EuiProvider in favor of the defaul…
Browse files Browse the repository at this point in the history
…t cache Emotion provides

- which will automatically set compat = true
  • Loading branch information
cee-chen committed Oct 4, 2022
1 parent 41e4ac5 commit 88ac73a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/components/provider/__snapshots__/provider.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ exports[`EuiProvider applying modifications propagates \`modify\` 1`] = `
"key": "css",
"nonce": undefined,
"prepend": undefined,
"speedy": [Function],
"tags": Array [],
},
}
Expand Down Expand Up @@ -379,6 +380,7 @@ exports[`EuiProvider changing color modes propagates \`colorMode\` 1`] = `
"key": "css",
"nonce": undefined,
"prepend": undefined,
"speedy": [Function],
"tags": Array [],
},
}
Expand Down Expand Up @@ -727,6 +729,7 @@ exports[`EuiProvider is rendered 1`] = `
"key": "css",
"nonce": undefined,
"prepend": undefined,
"speedy": [Function],
"tags": Array [],
},
}
Expand Down Expand Up @@ -1814,6 +1817,7 @@ exports[`EuiProvider providing an @emotion cache config applies the cache to glo
"key": "css",
"nonce": undefined,
"prepend": undefined,
"speedy": [Function],
"tags": Array [],
},
}
Expand Down Expand Up @@ -2184,6 +2188,7 @@ exports[`EuiProvider providing an @emotion cache config applies the cache to uti
"key": "css",
"nonce": undefined,
"prepend": undefined,
"speedy": [Function],
"tags": Array [],
},
}
Expand Down Expand Up @@ -2554,6 +2559,7 @@ exports[`EuiProvider providing an @emotion cache config provides a default cache
"key": "css",
"nonce": undefined,
"prepend": undefined,
"speedy": [Function],
"tags": Array [],
},
}
Expand Down Expand Up @@ -2901,6 +2907,7 @@ exports[`EuiProvider using \`null\` theme option does not add global styles 1`]
"key": "css",
"nonce": undefined,
"prepend": undefined,
"speedy": [Function],
"tags": Array [],
},
}
Expand Down
5 changes: 1 addition & 4 deletions src/components/provider/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React, { PropsWithChildren } from 'react';
import createCache from '@emotion/cache';
import { cache as fallbackCache } from '@emotion/css';
import { EmotionCache } from '@emotion/react';

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

const fallbackCache = createCache({ key: 'css' });
fallbackCache.compat = true;

export interface EuiProviderProps<T>
extends Omit<EuiThemeProviderProps<T>, 'children' | 'theme'>,
EuiGlobalStylesProps {
Expand Down

0 comments on commit 88ac73a

Please sign in to comment.