question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The api setQueryParams not working

See original GitHub issue

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 Screen Shot 2019-10-29 at 11 58 34 AM

Code snippets Screen Shot 2019-10-29 at 11 57 30 AM

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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
alexreardoncommented, Apr 6, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found