When Vaadin Hilla starts, it automatically generates a .bak file and modifies the types.d.ts file by adding:
declare module '*.css?inline' {
import type { CSSResultGroup } from 'lit';
const content: CSSResultGroup;
export default content;
}
declare module 'csstype' {
interface Properties {
[index: `--${string}`]: any;
}
}
How can I prevent it from automatically modifying the files?
Because this will cause an error when I use it. Is there an issue with how I'm using it?
interface ExtendCSSProperties extends React.CSSProperties {
'--rangepicker-bg'?: string;
}
export type RangePickerProps = RangePickerProps & {
backgroundColor?: string;
isDarkStyle?: boolean;
noBorder?: boolean;
style?: ExtendCSSProperties;
};
declare const RangePicker: React.FC<RangePickerProps>;
export default RangePicker;
<RangePicker
className="datapicker_36"
style={{ width: "270px", marginRight: "20px" }}
Error: error TS2353: Object literal may only specify known properties, and 'width' does not exist in type 'CSSProperties & ExtendCSSProperties'.