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.

Make ID of root component configurable

See original GitHub issue

Is your feature request related to a problem? Please describe. I have an application that always lives within a third party frame that provides some context that the components rely on. This frame is outside my control, and assumes that there will be some root level structure on the page. It also assumes that all content will be rendered within a <main id="ps-main"> tag.

Describe the solution you’d like A way to provide to storybook the id of the element to use as the react root when a preview-body is provided.

Describe alternatives you’ve considered Without a way to configure what the react root that storybook uses is, the only workaround I have is to supply a preview-body with incomplete html, omitting the closing tag of the main so that storybook will render content within it. Not only does this feel gross, it also still inserts additional elements between my app and the surrounding frame, which occasionally causes problems.

Are you able to assist bring the feature to reality? Yes, I can… I haven’t worked on storybook before but I’d be happy to submit a PR if this sounds like something that could get merged.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
shilmancommented, Jun 26, 2020

@schicks Ok, I’d like to see who else has this problem–this is the first time we’ve received this request after tens of thousands of projects using Storybook. Adding a configurable root is easy from a code standpoint, but would be a maintenance nightmare, so I don’t think it’s going to happen.

0reactions
stale[bot]commented, Aug 24, 2020

Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create Custom Components in React - DigitalOcean
In this project, <App> is the root component in index.js . To make it appear in your application, you'll need to add to...
Read more >
Launching your app with a root module - Angular
The application launches by bootstrapping the root AppModule , which is also referred to as an entryComponent . Among other things, the bootstrapping...
Read more >
Hst Component Configuration - Bloomreach
The root Component writes to the HTTP response. ... has a value of hst:pages/newsoverview, which is the root component id for the news...
Read more >
AEM Components - The Basics | Adobe Experience Manager
Before starting to actually configure or code your component you should ask: What exactly do you need the new component to do? A...
Read more >
create-react-app React File Structure - Pluralsight
While components can reside in src/components/my-component-name, it is recommended to have an index.js inside that directory. Thus, whenever ...
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