addon-jsx
addon-jsx copied to clipboard
[Bug] JSX tab remains visible when addon is disabled
Describe the bug
When this addon is disabled for a story, the "JSX" tab is still shown in the addons panel, but with blank contents.
Steps to reproduce the behavior
- Clone this repo: https://github.com/TrevorBurnham/storybook-addon-jsx-disable-noop
- Run
yarn && yarn storybook - Visit http://localhost:6006/?path=/story/example-button--primary
- Open the addons panel
Notice that the JSX tab is visible but blank because of this code:
Primary.parameters = {
jsx: {
disable: true,
},
};
Expected behavior
The JSX tab should not be shown in the addons panel when the addon is disabled. This is the behavior for other addons; for example, this code hides the Actions tab for the story:
Primary.parameters = {
actions: {
disable: true,
},
};
Screenshots and/or logs
When not disabled
When disabled
Environment
- OS: macOS 11.5.2
- Node.js version: 15.10.0
- NPM version: Yarn 3.0.1
- Browser (if applicable): Chrome
- Browser version (if applicable): 92
Additional context
The repro project uses @storybook/[email protected]. The project where I first observed this issue was on @storybook/[email protected].
I'm not sure what the problem here is, since the way the addon uses makeDecorator (#110) looks perfectly normal to me. Maybe something about that API has changed in more recent versions of Storybook? cc @petermikitsh @hipstersmoothie
I just ran into this as well, I believe it's because paramKey is not specified here. This is what's required according to storybook docs