Skip to content

Commit

Permalink
🐛 fix: 补回 injectGlobal 方法丢失的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 18, 2023
1 parent b83cb77 commit 111bcc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/functions/createInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export const createInstance = <T = any>(options: CreateOptions<T>) => {
speedy: options.speedy,
});

const { cache, sheet, hydrate, keyframes, flush, merge, getRegisteredStyles } = emotion;
const { cache, sheet, hydrate, injectGlobal, keyframes, flush, merge, getRegisteredStyles } =
emotion;

const classNameGenerator = createClassNameGenerator(cache, options.hashPriority);
const cx = createCX(classNameGenerator, emotion.cx);
Expand Down Expand Up @@ -97,6 +98,10 @@ export const createInstance = <T = any>(options: CreateOptions<T>) => {
css: serializeCSS,
cx,
keyframes,
/**
* @deprecated
*/
injectGlobal,

//******************** //
//**** 样式表管理 **** //
Expand All @@ -107,7 +112,7 @@ export const createInstance = <T = any>(options: CreateOptions<T>) => {
merge,
hydrate,
getRegisteredStyles,
emotion,
styleInstance: emotion,
// ******************** //
// ***** 主题相关 ***** //
// ******************** //
Expand Down
6 changes: 5 additions & 1 deletion src/functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export const {
cx,
keyframes,
//**** 样式表管理 **** //
emotion,
styleInstance: emotion,
/**
* @deprecated
*/
injectGlobal,
flush,
hydrate,
sheet,
Expand Down

0 comments on commit 111bcc7

Please sign in to comment.