Git Product home page Git Product logo

Comments (2)

hrsh7th avatar hrsh7th commented on August 22, 2024 1

ah. I understand why there is a problem in my situation.

The problem seems to be the file layout of my project.

In my project I have components located in "%ComponentName%/indext.tsx" and all stories located in "%ComponentName%/index.stories.tsx".
(There are also "page.tsx" and "page.stories.tsx".)

I would consider changing the file layout or specifying the story name explicitly.

thank you for your answer.

from ladle.

tajo avatar tajo commented on August 22, 2024

It's the combination of filename/storyName/title (whichever is present) and exported name that needs to be unique. This unique story ID is not only used internally for code-splitting but it also directly translates into the sidebar navigation.

In theory, we could add the filepath in but

  • it would expose the file structure in the URL
  • it would be confusing to have 2 identically named stories in the same sidebar slot

I don't think this is something we want to support. It should be pretty easy to make sure that these IDs are unique by adding/changing

export default {
 title: "..."
}

or

Story.storyName = "..."

If there are a lot of clashing stories, a codemod could be written.

from ladle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.