Function
applyDefaultTheme
({ theme = {}, className, ...props }: IProps)
Source from the content-addressed store, hash-verified
| 34 | } |
| 35 | |
| 36 | export function applyDefaultTheme({ theme = {}, className, ...props }: IProps) { |
| 37 | // Since styled-components defaults the `theme` prop to an empty object |
| 38 | // inside of the styled component if a ThemeProvider is not present, |
| 39 | // we check against the number of keys. |
| 40 | return { |
| 41 | ...props, |
| 42 | theme: (Object.keys(theme).length === 0 ? defaultTheme : theme) as DefaultTheme, |
| 43 | }; |
| 44 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected