How to save localStorage per story in storybook

Viewed 489

Is it possible to save something to localStorage/sessionStorage per story and/or per stories file?

Is there any addon for this, I can't find any

I would expect something like

Default.parameters = {
    sessionStorage: {
        userId: '123'
    }
};
1 Answers

A neat solution I found was to actually store item to local storage before returning your story component.

Related