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
{{ message }}
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
import{useEffect,useGlobals}from'@storybook/client-api';// ....exportconstButtonStory: Story<PropsWithChildren<ButtonProps>>=(args)=>{const[_,updateGlobals]=useGlobals();useEffect(()=>{// enable dark mode when component mountsupdateGlobals({darkMode: true});// disable dark mode when component unmountsreturn()=>updateGlobals({darkMode: false});},[]);return(<Button{...args}>{args.children}</Button>);};ButtonStory.args={variant: ButtonVariant.PRIMARY,children: 'Button',};
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I wonder if there is any way we could set up default for specific stories. It would make a lot faster to test impact of changes using chromatic
The text was updated successfully, but these errors were encountered: