The api setQueryParams not working
See original GitHub issueDescribe 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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (10 by maintainers)
Top Results From Across the Web
REST API - setQueryParameter with front slash not - ServiceNow
Solved: Hi All, I am trying to get data from external resource using REST call. When I set parameter with '/' is not...
Read more >Flurl - The elegant way to build URLs & set query params in .Net
A common task when calling web apis or resources from code is building a URL and adding the necessary query string and parameters....
Read more >How do you programmatically update query params in react ...
Within the push method of hashHistory , you can specify your query parameters. For instance, history.push({ pathname: '/dresses', ...
Read more >API - Storybook
This method allows you to set query string parameters. You can use that as temporary storage for addons. Here's how you set query...
Read more >Addon API - Storybook - JS.ORG
This method allows you to register an addon and get the storybook API. ... may unmount your addon component, so keeping local state...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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