diff --git a/packages/react-base16-styling/src/index.ts b/packages/react-base16-styling/src/index.ts index 43c4e27f..036c21fa 100644 --- a/packages/react-base16-styling/src/index.ts +++ b/packages/react-base16-styling/src/index.ts @@ -157,7 +157,7 @@ const getStylingByKeys = ( .map((key) => mergedStyling[key as string]) .filter(Boolean); - const props = styles.reduce( + const props = styles.reduce( (obj, s) => { if (typeof s === 'string') { obj.className = [obj.className, s].filter(Boolean).join(' '); @@ -176,7 +176,7 @@ const getStylingByKeys = ( delete props.className; } - if (Object.keys(props.style).length === 0) { + if (Object.keys(props.style!).length === 0) { delete props.style; } diff --git a/packages/react-base16-styling/src/types.ts b/packages/react-base16-styling/src/types.ts index 6ec9dc98..58839f8e 100644 --- a/packages/react-base16-styling/src/types.ts +++ b/packages/react-base16-styling/src/types.ts @@ -2,8 +2,8 @@ import { Base16Theme } from 'base16'; import * as CSS from 'csstype'; export interface Styling { - className: string; - style: CSS.Properties; + className?: string; + style?: CSS.Properties; } export type StylingValueFunction = (