React Typescript - Controls Addon enum control not rendering consistently
See original GitHub issueCreated a vite app and corresponding storybook using commands:
npm init @vitejs/app my-vite-app
npx sb@next init --builder storybook-builder-vite
Firing up the storybook and looking at the Button -> Large story the control for the size prop renders as a text input. If you disable the vite builder in the main.js and use default webpack core it will render the size prop as radio buttons which is the documented control in Controls Docs
The control for the primary boolean property and the onClick are also missing. Manually providing the control config via argTypes will render the size control correctly.
Vite:
Webpack:
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
React Typescript - Controls Addon enum control not rendering ...
Firing up the storybook and looking at the Button -> Large story the control for the size prop renders as a text input....
Read more >How to show TypeScript enum member names in Storybook ...
I'm using Storybook with React and TypeScript. ... type are TypeScript enums, they are rendered in the “Controls” panel using their index:.
Read more >Controls - Storybook - JS.ORG
Storybook Controls gives you a graphical UI to interact with a component's arguments dynamically without needing to code. It creates an addon panel...
Read more >React Storybook Controls - The easy way - DEV Community
It streamlines UI development, testing, and documentation. Storybook for React offers functionality to control props from a very pretty ui.
Read more >Documentation - ECMAScript Modules in Node.js - TypeScript
This setting controls whether .js files are interpreted as ES modules or CommonJS modules, and defaults to CommonJS when not set. When a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, I tried it out to change the component name to be the same as the filename and it solved my issue right now. Probably the best workaround until https://github.com/joshwooding/vite-plugin-react-docgen-typescript/issues/2 got an update.
Thanks again @IanVS , I really appreciate it!
Thanks for reporting this, and for the reproduction, @mupinnn. @joshwooding, you’ll be interested in this one. I opened https://github.com/joshwooding/vite-plugin-react-docgen-typescript/issues/2, since I think it’s an issue in the react-docgen-typescript plugin.