In our project, there's an InfoBox with boxStyles applied. Since the latest update, I'm getting a TS error that
Type '{ padding: string; width: string; }' is missing the following properties from type 'CSSStyleDeclaration': accentColor, alignContent, alignItems, alignSelf, and 476 more.
And while I'm quite fond of the opportunity to test my knowledge of all the CSS style declarations, I guess this could be resolved in an easier way by turning the type from boxStyle?: CSSStyleDeclaration | undefined; to boxStyle?: Partial<CSSStyleDeclaration> | undefined; 😄
Your Environment
os: mac
node --version 16.14.2
react version 18
webpack version – using Vite
@babel version doesn't matter 😊
@react-google-maps/api version 2.19.1
How does it behave?
As described, getting a type error.
How should it behave correctly?
As described, boxStyle should use Partial<> to allow someCSSStyleDeclaration and not ask for ALL of them.
Issue template
Please provide an explanation of the issue
As lined out in https://github.com/JustFly1984/react-google-maps-api/pull/3260#pullrequestreview-1535328776, I think the type for
boxStyle
is not correct. Here's the location in the codeIn our project, there's an
InfoBox
withboxStyles
applied. Since the latest update, I'm getting a TS error thatAnd while I'm quite fond of the opportunity to test my knowledge of all the CSS style declarations, I guess this could be resolved in an easier way by turning the type from
boxStyle?: CSSStyleDeclaration | undefined;
toboxStyle?: Partial<CSSStyleDeclaration> | undefined;
😄Your Environment
os: mac
node --version
16.14.2
react version
18
webpack version – using Vite
@babel version doesn't matter 😊
@react-google-maps/api version
2.19.1
How does it behave?
As described, getting a type error.
How should it behave correctly?
As described,
boxStyle
should usePartial<>
to allow someCSSStyleDeclaration
and not ask for ALL of them.