Closed mljlynch closed 8 months ago
Hey this should be working but it might be the type. I think theres a ComponentStoryObj type, maybe thats the one.
Heres an example from the example in this repo. The reason that theres is a difference is that in v6.5 of storybook CSF3 was in preview and later the types were simplified for v7. When v7 rn storybook goes out then it will have the simplified types too.
import type { ComponentMeta, ComponentStoryObj } from '@storybook/react-native';
import { Switch } from './Boolean';
const BooleanExample: ComponentMeta<typeof Switch> = {
title: 'ControlExamples/Boolean Control',
component: Switch,
};
export default BooleanExample;
type BooleanStory = ComponentStoryObj<typeof Switch>;
export const Basic: BooleanStory = {};
export const On: BooleanStory = { args: { on: true } };
Got it - this worked thanks!
Describe the bug A clear and concise description of what the bug is.
To Reproduce I have the following code:
But I'm getting a type error:
Expected behavior
I would expect the types to be inferred from the component prop types
Library "@storybook/react-native": "^6.5.4",