Skip to content

Commit

Permalink
feat(plugins): 运行时 styled components 支持 function
Browse files Browse the repository at this point in the history
  • Loading branch information
hualigushi committed Jun 21, 2023
1 parent 9b63e82 commit 1287eab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/plugins/src/styled-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ export { styled, ThemeProvider, createGlobalStyle, css, keyframes, StyleSheetMan
content: `
${styledComponentsRuntimeCode}
export function rootContainer(container) {
const globalStyle = styledComponentsConfig.GlobalStyle ? <styledComponentsConfig.GlobalStyle /> : null;
const scConfig =
typeof styledComponentsConfig === 'function'
? styledComponentsConfig()
: styledComponentsConfig;
const globalStyle = scConfig.GlobalStyle ? <scConfig.GlobalStyle /> : null;
return (
<>
{globalStyle}
Expand Down

0 comments on commit 1287eab

Please sign in to comment.