Yadong (Adam) Zhang

Results 97 comments of Yadong (Adam) Zhang

and storybook 6.4.22 is only compatible with react 16 or 17: you can try it by yourself: ```shell npx create-react-app my-app --template typescript npm i --save-dev @storybook/[email protected] ``` ref: [how...

@daniel-stoian-lgp the error was reported by react, so have you tried it in CRA without storybook? the component will be used in the real react component finally, so even if...

here the `children` should be react elements like `Button.stories.jsx`: but actually, it is an array: as we known, `typeof [] === 'object'` in Javascript, as the error showed.

According to the error call stack, it's caused by this line: https://github.com/storybookjs/storybook/blob/3929b4a9c80ec8b883548fecaba63f6228c4db61/app/react/src/client/docs/jsxDecorator.tsx#L123 and this ilne is imported from `react-element-to-jsx-string`: https://github.com/algolia/react-element-to-jsx-string/blob/1e3a6089e91226f019907c1def135de7d7c18dfd/src/parser/parseReactElement.js#L96 the package is new after `6.4.22`, you can see it's...

can not reproduce with `builder-webpack5`: ```shell # setup react app npx create-react-app example-webpack5 --template typescript # switch to app cd example-webpack5 # setup storybook npx storybook init # run storybook...

**Update**: @Jamess-Lucass `button` component must be capitalized - `Button.tsx` works for me.

`button` will also break with `builder-webpack5`, not sure if it's a bug 👀

@Jamess-Lucass Yes, you're right, the difference between the 2 name conventions is if triggered `isForwardRef` condition, I am not sure if it's a bug 🐛.

I guess the `_c` is generated here: https://github.com/storybookjs/storybook/blob/f2324595c8953682dec3be6a3201aca577ad9467/lib/core-common/src/utils/to-importFn.ts#L34-L39 which is called by `importFn`: https://github.com/storybookjs/storybook/blob/f2324595c8953682dec3be6a3201aca577ad9467/lib/store/src/StoryStore.ts#L125

Maybe this is an issue related to Webpack (both for `builder-webpack4` and `builder-webpack5`)? 👀 can be reproduced **without** the storybook setup.