Skip to content

Try to get Chromatic components to react to theme changes

Administrator requested to merge vb/chromatic-dark-mode-change into main

Created by: valerybugakov

@limitedmage, I've created a separate PR because your previous commits work great, and I didn't want to overwrite the history in your branch. Events didn't work properly because decorators and stories were mounted twice. This behavior is caused by the bug, which should be addressed in the next Storybook release.

Double mount didn't affect the Chromatic decorator, so the event was emitted only once for the first mount. On the second mount isLightTheme value was set based on the initial value and was never updated after that.

Moves https://github.com/sourcegraph/sourcegraph/pull/21000 forward via this commit. Fixes #20687 (closed)

Merge request reports

Loading