You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Expo+Storybook点击ADDONS按钮报错:CSSStyleDeclaration索引属性设置失败

Storybook点击ADDONS按钮报错:Indexed property setter is not supported

点击Story页面的ADDONS按钮时,出现如下错误:

Failed to set an indexed property on 'CSSStyleDeclaration': Indexed property setter is not supported

已排查确认:移除Button组件的color属性后,一切正常。

使用环境:

  • expo SDK 49
  • react-native-elements (rneui) 4.0.0-rc.8
  • @storybook/react-native 6.5.6

我的Story代码如下:

import React from "react";
import { Button } from "@rneui/themed";

const MyButtonMeta = {
  title: "MyButton",
  component: Button,
  argTypes: {
    onPress: { action: "pressed the button" },
  },
  args: {
    title: "Hello world",
    color: "error",
  },
  decorators: [(Story) => <Story />],
};

export default MyButtonMeta;

export const Basic = {};

export const AnotherExample = {
  args: {
    title: "Another example",
    color: "error",
  },
};

求解决思路,感谢!

内容的提问来源于stack exchange,提问作者Mohammad Reza

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 22:28:19