Skip to content

Commit b5e0849

Browse files
committed
(theme-provider) Assert emotionTheme as Theme
1 parent c4b3347 commit b5e0849

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/theme-provider/src/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ import { Global } from '@emotion/core'
1111

1212
const BodyStyles = () =>
1313
jsx(Global, {
14-
styles: (theme: Theme) => {
15-
if (theme.useBodyStyles === false || (theme.styles && !theme.styles.root))
14+
styles: emotionTheme => {
15+
const theme = emotionTheme as Theme
16+
if (
17+
theme.useBodyStyles === false ||
18+
(theme.styles && !theme.styles.root)
19+
) {
1620
return false
17-
const boxSizing = theme.useBorderBox === false ? null : 'border-box'
21+
}
22+
const boxSizing = theme.useBorderBox === false ? undefined : 'border-box'
1823

1924
return css({
2025
'*': {

0 commit comments

Comments
 (0)