-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The api setQueryParams not working #8600
Comments
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I can confirm that this API is not working |
|
This line is clearing the query string: storybook/lib/api/src/modules/url.ts Line 93 in b6136e1
|
The queryParam is for the preview, not the manager.
|
So is there a way from my addon panel to set something in the query string? I am using the API in the same way as it is being used in the docs: https://storybook.js.org/docs/addons/api/#apisetqueryparams |
Why would you need to set something on the query of storybook's manager? |
Hi @ndelangen |
For refreshes you could use the localStorage instead? |
the route trigger enable tab is more make sense, I had used this API a long time ago, it's was broken after I upgrade the storybook, so that's why I report the issue. |
@echoulen you're 100% correct. The API used to set queries on the manager as well, but when we changed to use a router we removed this behavior so we could have clearer/readable URLs that wouldn't grow to be too long. |
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 |
I agree that'd be useful |
@ndelangen I see |
I think this problem has in essence been resolved by making globals persist on the URL: |
Describe the bug
The method
api.setQueryParams
not workingTo Reproduce
Expected behavior
expect api.getQueryParam("abc") to be "hello"
Screenshots
Code snippets
System:
Additional context
The addon was not working with
api.setQueryParams
andapi.getQueryParam
any morehttps://github.com/echoulen/storybook-addon-styled-component-theme
The text was updated successfully, but these errors were encountered: