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

154 Views Asked by At

when I click on ADDONS button on story page, I get the following error:

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

This is my 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",
  },
};

there are some issues with color property because if I remove this, everything works fine!

Any idea? tnx

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

enter image description here

1

There are 1 best solutions below

0
Mohammad Reza On

I placed the color inside an array.

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",
  },
  decorators: [
    (Story) => <Story />
  ],
};

export default MyButtonMeta;

export const Basic = {
  args: {
    title: "Basic",
    type: 'clear',
    color: ['warning']  // <------- HERE
  },
};

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