Addon-controls: Warn if docs preset is run after controls
See original GitHub issueAddon-controls
requires addon-docs
and also requires that its preset is run earlier in the main.js
addons
array. We should check for this automatically and warn if its misconfigured because people might not see this in the docs.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
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 >@storybook/addon-controls | Yarn - Package Manager
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 >Storybook Failed in Very First Try in New Create-React-App
I just created new react app with create-react-app and run npm start . ... '@storybook/addon-controls' (or '@storybook/addon-essentials') in ...
Read more >@storybook/addon-controls - npm
Start using @storybook/addon-controls in your project by running `npm i ... Expanded: show property documentation; Hide NoControls warning.
Read more >Source code for pyxbmct.addoncontrols
[docs]class ControlWithConnectCallback(object if _XBMC4XBOX else ... int, int) -> None """ Called after the control has been placed in a Window or Group....
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 FreeTop 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
Top GitHub Comments
👋 I am running into this warning as well, I am using a self-created preset which looks like:
['@storybook/addon-essentials', '@storybook/addon-a11y']
and my app configuration is just['my-preset']
.After doing some digging, I see that the checker only ever receives my app configuration rather than the preset config. This means the indexOf’s return -1 rather than >= 0 (because neither controls, docs or essentials is explicitly listed in my app).
I’m not sure what the solution is though 😦 - would it be expected that the checker resolve my-preset to figure out if that’s loading the presets in the correct order?
@benbender it’s a complicated system and we’ll overhaul it at some point soon.
what’s going on is that there’s a whole pipeline of argType inference that happens at startup time. this includes args that the user provides, e.g.
args: { a: 3 }
=> "there’s an arg calleda
that’s a number. there’s also metadata that’s extracted from the source code of thedefault.component
. and finally, if the user manually specifiesargTypes
, those take precedence. there are even a few more steps that i’m omitting for clarity.for historical reasons,
addon-docs
is responsible for thedefault.component
analysis. this is why we expect that to happen before the controls addon consumes the results. in the next iteration (hopefully in 6.4), that analysis will happen outside ofaddon-docs
, and that weird inter-addon dependency won’t be necessary.