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.

Common name prefix causes rapid switching between stories on load

See original GitHub issue

This appears to have been introduced in 6.0.0-beta.33.

Using these stories:

import { storiesOf } from '@storybook/react';
import React from 'react';

storiesOf('test', module)
  .add('x y', () => {
    console.log('render x y'); 
    return <div>x y</div>
  })
  .add('x', () => {
    console.log('render x');
    return <div>x</div>
  });

if you start on the “x” story and then reload the page, it will switch to the “x y” story, and the console prints

render x y
render x
render x y

(In my real project using typescript it actually switches between the 2 stories many more times, sometimes endlessly.)

This seems somehow related to the fact that the second story’s name is a prefix of the first. If you change the second story name to “x z” the bug doesn’t occur. It also doesn’t occur if you change the order of the stories or change which one is selected at the beginning.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
shilmancommented, Jul 22, 2020

Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-rc.14 containing PR #11637 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there’s still more to do.

1reaction
tmeasdaycommented, Jul 22, 2020

I’ll take a look, thanks @pelotom

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code-switching - Wikipedia
In linguistics, code-switching or language alternation occurs when a speaker alternates between two or more languages, or language varieties, in the context ...
Read more >
Switching and Passive Influence | DID-Research.org
Switching refers to one alter taking control of the body, being given control by another alter, or gaining prominence over another alter.
Read more >
Configure and Verify Ethernet 10/100/1000Mb Half ... - Cisco
This document describes the guidelines to troubleshoot, as well as isolate and resolve, Ethernet auto-negotiation issues.
Read more >
13 Beginner Mistakes To Avoid In Revit
In your BIM standards, make sure to have a clear way to name views. A good tip is to add a number prefix...
Read more >
Cloud Classification - National Weather Service
Low-level clouds are not given a prefix, although their names are derived from "strato-" or "cumulo-", depending on their characteristics.
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