Is your feature request related to a problem? Please describe.
We have a global decorator that wraps all the stories with a "ThemeProvider" wrapper, something like this:
export const decorators = [
(Story) => (
<ThemeProvider theme={"light"}>
<Story />
</ThemeProvider>
),
];
The problem is that I can't find a way to provide control or anything to update the theme from each story.
Describe the solution you'd like
I would want to be able to provide args, argTypes, or anything to the global decorator that allows me to update this theme prop for every story.
Describe alternatives you've considered
-
I've looked into storybook documentation for React that allows us to define args at the global level in preview.js, but this does not seem to work with storybook version of react-native
https://storybook.js.org/docs/6.5/react/writing-stories/args#global-args
-
Also according to the React storybook documentation, we are able to specify "global types" in our toolbar, but seems like this addon is not supported in storybook react-native
https://storybook.js.org/docs/6.5/react/essentials/toolbars-and-globals#globals
Are you able to assist bring the feature to reality?
no
Additional context
For context, I'm on storybook 6.5.6
Is your feature request related to a problem? Please describe.
We have a global decorator that wraps all the stories with a "ThemeProvider" wrapper, something like this:
The problem is that I can't find a way to provide control or anything to update the theme from each story.
Describe the solution you'd like
I would want to be able to provide
args,argTypes, or anything to the global decorator that allows me to update this theme prop for every story.Describe alternatives you've considered
I've looked into storybook documentation for React that allows us to define
argsat the global level inpreview.js, but this does not seem to work with storybook version of react-nativehttps://storybook.js.org/docs/6.5/react/writing-stories/args#global-args
Also according to the React storybook documentation, we are able to specify "global types" in our toolbar, but seems like this addon is not supported in storybook react-native
https://storybook.js.org/docs/6.5/react/essentials/toolbars-and-globals#globals
Are you able to assist bring the feature to reality?
no
Additional context
For context, I'm on storybook
6.5.6