Common name prefix causes rapid switching between stories on load
See original GitHub issueThis 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:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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.
I’ll take a look, thanks @pelotom