Closed thany closed 1 year ago
I think this issue is in this hook: https://github.com/hipstersmoothie/storybook-dark-mode/blob/master/src/Tool.tsx#L181
The current
value set in the store is being overwritten with the default that was defined in the parameters. I think it needs to be updated to prefer the store's current and fallback to the params current.
updateStore({
...currentStore,
...darkModeParams,
current: currentStore.current || darkModeParams.current,
});
I went ahead and made a PR for the change after testing it locally and having the theme persist between refreshing and story changes: https://github.com/hipstersmoothie/storybook-dark-mode/pull/185
Gonna close this since a pr was submitted to fix. if it persists feel free to create another PR
I added a default theme:
This causes the theme to reset to
light
every time when selecting another story.This is incorrect when considering the documention:
So, a previously set theme by the user should take precedence. And it'd make perfect sense if it did that.