You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose one of my theme class is theme-twitter. Using the dropdown from this plugin works great.
However, I also have a button inside my story that can add/remove theme-twitter from dom on body tag. The moment the class gets added, this plugin removes the added class from the body.
I understand I can provide root, or body etc, but I want to keep body tag. I want to be able to modify body classes from within story without this plugin overwriting it as it sees fit. How can I achieve that?
The text was updated successfully, but these errors were encountered:
If the logic of adding the updating the body class is inside the component, you might not want to change it to adapt the behaviour for storybook.
Then this way, it is probably incompatible.
One possible way would be to extract the logic from your component and add a onThemeChange props in your component.
In your app the logic will be handled by the parent.
In Storybook it will be handled by a wrapper component that will update the theme in the addon.
For now it is not possible to set the theme from outside, but if this feature is added, you will should also need to adapt your component.
Suppose one of my theme class is
theme-twitter
. Using the dropdown from this plugin works great.However, I also have a button inside my story that can add/remove
theme-twitter
from dom on body tag. The moment the class gets added, this plugin removes the added class from the body.I understand I can provide root, or body etc, but I want to keep body tag. I want to be able to modify body classes from within story without this plugin overwriting it as it sees fit. How can I achieve that?
The text was updated successfully, but these errors were encountered: