MCPcopy Create free account
hub / github.com/apitable/apitable / applyDefaultTheme

Function applyDefaultTheme

packages/components/src/theme/index.ts:36–44  ·  view source on GitHub ↗
({ theme = {}, className, ...props }: IProps)

Source from the content-addressed store, hash-verified

34}
35
36export 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

Calls 1

keysMethod · 0.65

Tested by

no test coverage detected