Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable jsx per story #110

Merged
merged 3 commits into from
Jun 5, 2020

Conversation

petermikitsh
Copy link
Contributor

@petermikitsh petermikitsh commented Jun 4, 2020

Closes #109

This adds the functionality to disable via CSF:

export const Simple = () => (
  <div>Hello</div>
);

Simple.story = {
  parameters: {
    jsx: {
      disable: true,
    },
  },
};

I tried to add an example to the example directory, but I'm struggling since these stories don't use CSF format

@hipstersmoothie
Copy link
Contributor

So the change is basically wrapping the decorator in makeDecorator?

@hipstersmoothie
Copy link
Contributor

It's fine there is no example. Could you add an example to the README.md?

@petermikitsh
Copy link
Contributor Author

So the change is basically wrapping the decorator in makeDecorator?

Correct. makeDecorator contains the logic to short-circuit the addon when it is disabled.

https://github.com/storybookjs/storybook/blob/08cb4a9a03703c0c9b1966e554feac07f272a791/lib/addons/src/make-decorator.ts#L22

Also, I've updated the README

@hipstersmoothie hipstersmoothie added the minor Increment the minor version when merged label Jun 5, 2020
@hipstersmoothie hipstersmoothie merged commit 9a509cd into storybookjs:master Jun 5, 2020
@hipstersmoothie
Copy link
Contributor

Thanks for the contribution!

@hipstersmoothie
Copy link
Contributor

🚀 PR was released in v7.3.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to disable this addon for a single story?
2 participants