首页 > 解决方案 > 主题-ui zIndices 对象打字稿错误

问题描述

我们的主题对象有一个 zIndices 对象

  ...
  zIndices: {
    proxyTray: 571,
    proxyTrayOverlay: 570,
    ruleMenu: 551,
    ... etc ...
  }
  ...

升级到最新的 theme-ui (0.9) 后,我收到了很多这种类型的 TS 错误:

Property 'fixedButton' does not exist on type 'ZIndex[]'.

132           zIndex: ({ zIndices }): number => zIndices.fixedButton + 1,

zIndices 必须是一个数组吗?我认为这曾经可以正常工作

标签: reactjstypescripttheme-ui

解决方案


推荐阅读