My stories.tsx code looks like this:
export default {
title: "Components/Switch",
argTypes: {
color: { control: "select", options: ["primary", "secondary"] },
},
};
However, the page just fails to render when I do that.
To reproduce:
Clone this repository: https://github.com/jauggy/storybook-args-error
npm i
npm run storybook
Select the Switch component on the left menu.
options
array as a child ofcolor
and a sibling ofcontrol
. This also works in Storybook v6.2 – Messenger