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.

url params don't work for some args (protected names maybe?)

See original GitHub issue

Describe the bug

After reading that storybook supports controlling args through URL parameters [1] [2], I am trying it out, because I had a great use case for linking to a particular set of props for a component from my release notes.

However, it seems that when the prop you want to control is called name, or when you want to control the children prop, this method doesn’t work.

To Reproduce

I have a prop that has a type like this:

name: 'foo' | 'bar' | 'baz' | ...

I tried a URL param like this:

&args=name:foo

but it had no effect.

There are, however, other props that do work just fine, and they have similar types. For example I have props like

color?: 'default' | 'primary' | 'secondary' | 'inherit'

and passing

&args=name:foo;color:secondary

does correctly set the color, even though the name prop gets ignored.

This leads me to suspect that it’s the name name itself that is causing the issue here. adding a new name prop to other components seems to suggest this is reproducible.

I’m also experiencing this with the children prop.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
aalpgiraycommented, Sep 15, 2021

I have just realised switching from react-docgen-typescript to react-docgen solves this. I don’t know where to open this bug report. You can checkout this documentation if you don know how to set this parameter.

https://storybook.js.org/docs/react/configure/typescript

1reaction
aantonyukcommented, Apr 21, 2021

I also see the same issue but with boolean attributes. When I switch to toggle from true to false it’s work perfect but when I refresh the page I see the error message.

3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular routing with parameters doesn't work when URL is ...
The fix is done by enabling using the hash in the routing. In app.module.ts RouterModule.forRoot( [ { path: 'Home', component: HomeComponent } ...
Read more >
URL Query Parameters with JavaScript, Vue 2 and Vue 3
Learn to read and write URL Query Parameters in JavaScript and VueJS to make dynamic, deep links within your application.
Read more >
How Do URL Parameters Work in Flask? - eduCBA
This method works very well even if the query string doesn't have the argument mentioned in the key. The second method is by...
Read more >
How and why does WP Rewrite certain URL query parameter?
... rewrites some but not all URL parameters and causes big problems doing so. ... perhaps this is expected because the URL params...
Read more >
Are URL parameters of GET and POST requests over HTTPS ...
TL;DR: HTTPS provides encryption, and it's the only thing protecting the parameters. It's well known that GET requests with ?xx=yy arguments ...
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