【问题标题】:Material UI TS1128: Declaration or statement expected for ButtonUnstyledPropsMaterial UI TS1128:ButtonUnstyledProps 需要声明或声明
【发布时间】:2022-01-23 05:57:56
【问题描述】:

我在尝试构建使用 Material UI 的应用程序时遇到了问题。我收到了这个 Typescript 错误,似乎找不到关于这个问题的答案

TypeScript error in C:/.../node_modules/@mui/base/ButtonUnstyled/index.d.ts(3,1):
Declaration or statement expected.  TS1128

    1 | export { default } from './ButtonUnstyled';
    2 | export { default as buttonUnstyledClasses, getButtonUnstyledUtilityClass, } from './buttonUnstyledClasses';
  > 3 | export type { default as ButtonUnstyledProps } from './ButtonUnstyledProps';
      | ^
    4 | export * from './ButtonUnstyledProps';
    5 | export { default as useButton } from './useButton';
    6 | export type { default as UseButtonProps } from './UseButtonProps';

我偶然发现了一个与 MUI 不同的组件的类似问题,将 React 升级到 16.14.0 解决了这个问题,但还没有解决这个问题。

【问题讨论】:

    标签: reactjs typescript material-ui


    【解决方案1】:

    经过大量测试和尝试不同的方法,然后从 TypeScript 3.7.2 升级到 3.8.3,问题得到解决,尽管 Material UI 文档说它至少需要 3.5

    【讨论】:

      猜你喜欢
      • 2020-03-22
      • 2021-02-09
      • 1970-01-01
      • 1970-01-01
      • 2020-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-06
      相关资源
      最近更新 更多