Describe the bug
When trying to add a ThemeProvider via addDecorator, it is not added to MDX stories.
To Reproduce
I've made a minimal reproduction over at https://github.com/jure/storybook-test.
git clone it, yarn, yarn storybookObserve the difference between the Button in a normal story (styled according to theme) and the Button in the MDX story - no theme applied.
Expected behavior
All stories should be decorated by addDecorator.
Screenshots


System:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Binaries:
Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
Browsers:
Chrome: 78.0.3904.108
Firefox: 70.0.1
Safari: 13.0.2
npmPackages:
@storybook/addon-actions: ^5.3.0-beta.15 => 5.3.0-beta.15
@storybook/addon-docs: 5.3.0-beta.15 => 5.3.0-beta.15
@storybook/addon-knobs: 5.3.0-beta.15 => 5.3.0-beta.15
@storybook/addon-links: ^5.3.0-beta.15 => 5.3.0-beta.15
@storybook/addons: ^5.3.0-beta.15 => 5.3.0-beta.15
@storybook/react: ^5.3.0-beta.15 => 5.3.0-beta.15
Thanks for the repro -- really helps!
The problem is that decorators only get applied to stories, and you're not defining any stories in your MDX. Here's how you'd do that:
import { Meta, Story } from "@storybook/addon-docs/blocks";
import Button from "./Button";
<Meta title="MDX|Test" />
A primary button.
<Story name="primary">
<Button primary>Save</Button>
</Story>
I knew it had to be something very simple like this! Thanks for the super quick response!
I was expecting that the whole MDX is treated as a story, but I can see how it's merely a container for them.
Most helpful comment
I knew it had to be something very simple like this! Thanks for the super quick response!
I was expecting that the whole MDX is treated as a story, but I can see how it's merely a container for them.