storybook: The api setQueryParams not working
Describe the bug
The method api.setQueryParams not working
To Reproduce
addons.register("storybook/something", (api) => {
api.setQueryParams({abc: "hello"});
});
Expected behavior expect api.getQueryParam(“abc”) to be “hello”
Screenshots

Code snippets

System:
"@storybook/addons": "^5.2.0",
"@storybook/react": "^5.2.0",
Additional context
The addon was not working with api.setQueryParams and api.getQueryParam any more
https://github.com/echoulen/storybook-addon-styled-component-theme
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 15 (11 by maintainers)
I would like to be able to set the URL for sharing purposes. Right now I am unable to do anything to the URL as an addon as it is always cleared
This line is clearing the query string: https://github.com/storybookjs/storybook/blob/b6136e1539c85d253504391a7d3f65e2c1239143/lib/api/src/modules/url.ts#L93