最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - vaadin hilla start automatically generate `types.d.ts.(RandomNum).bak`, and automatically add `declare module &#39

programmeradmin0浏览0评论

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'.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论