Skip to content
Discussion options

You must be logged in to vote

Good question — and no: an empty parameters.pseudo: {} will not clear it. The sync effect explicitly skips empty configs (the Object.keys(config).length > 0 guard in withPseudoState.ts) — pushing empty configs into globals on every story is precisely what used to wipe URL/toolbar state before the fix.

Programmatically: the pseudo state lives in the pseudo global, so anything that emits UPDATE_GLOBALS can clear it. If you want "reset on every story unless the story declares its own", this in .storybook/preview.ts should do it (untested sketch, but it follows the addon's own mechanism):

import { addons } from 'storybook/preview-api';
import { STORY_CHANGED, UPDATE_GLOBALS } from 'storybook/…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DmitriiKholodov
Comment options

@FrancoKaddour
Comment options

Answer selected by DmitriiKholodov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants