Not one example does not work render for me with typescript. I use vite or create-react-app . Storybook v 7.0.4 Help is needed. #22122
Unanswered
fr0ntsmaverick
asked this question in
General
Replies: 1 comment
-
I was able to figure out what was the reason for me. The file extension needed was ***.stories.tsx. And add import React from 'react'; to the ***.stories.tsx file. And then everything works. Perhaps this will help. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Not one example does not work render for me with typescript. I use vite or create-react-app . Storybook v 7.0.4 Help is needed.
ERROR in src/stories/Page.stories.ts:33:3
{args.footer}TS2322: Type '(args: {}) => boolean' is not assignable to type 'ArgsStoryFn<ReactRenderer, {}>'.
Type 'boolean' is not assignable to type 'StoryFnReactReturnType'.
31 |
32 | export const CustomFooter: Story = {
33 | render: (args) => (
| ^^^^^^
34 | <Page {...args}>
35 |
36 |
ERROR in src/stories/Page.stories.ts:34:5
{args.footer}TS2365: Operator '<' cannot be applied to types 'boolean' and 'RegExp'.
32 | export const CustomFooter: Story = {
33 | render: (args) => (
34 | <Page {...args}>
| ^^^^^^^^^^^^^^^^
35 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 |
37 | ),
38 | args: {
ERROR in src/stories/Page.stories.ts:34:5
{args.footer}TS2365: Operator '<' cannot be applied to types 'boolean' and 'RegExp'.
32 | export const CustomFooter: Story = {
33 | render: (args) => (
34 | <Page {...args}>
| ^^^^^^^^^^^^^^^^
35 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 |
| ^^^^^^^^^^^^
37 | ),
38 | args: {
39 | footer: 'Built with Storybook',
Beta Was this translation helpful? Give feedback.
All reactions