question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Typescript - Controls Addon enum control not rendering consistently

See original GitHub issue

Created 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: Screen Shot 2021-07-29 at 10 04 44 PM

Webpack: Screen Shot 2021-07-29 at 10 05 20 PM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mupinnncommented, Apr 22, 2022

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!

1reaction
IanVScommented, Apr 22, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found