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.

Top-level component to contain multiple artboards

See original GitHub issue

Currently, there’s no concept of anything that can ‘contain’ Artboards.

~A hack to get around this is to render multiple times —~

Ideally we’d have a <Page> component or something that could hold and arrange multiple artboards

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:35
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kristinbaumanncommented, Jul 12, 2017

@patrickhpan provided a gist to generate multiple artboards within one artboard here: https://gist.github.com/patrickhpan/a47ee004b5c77854be4cbfd29c09be17. Works quite well for me.

1reaction
patrickhpancommented, Apr 27, 2017

The difference to me is that in React it only really makes sense to have one “App” running at any time whereas in Sketch it’s highly useful to have multiple "App"s on the same Page to represent different states.

What about a nonstandard render() method that takes an optional third parameter, append, that defaults to true but if false calls

page.addLayers([layer]);

instead of

page.replaceAllLayersWithLayers([layer]);

Thus, you could use

render(<FirstThing />, page)
render(<AlsoOnSamePage />, page, false

to force rendering on the same page?


And rendering one component per page can be done using by calling context.document.removePage(context.currentPage()) enough times to remove all pages, and appending new blank pages into an array, and then rendering one component per page. This hack is here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Edit main components - Figma Help Center
Update components. To make sure Figma applies changes to all instances of a component, you will need to edit the main component. You...
Read more >
Fusion 360 Components & Bodies for New Designers
Read this blog to learn everything you need to know about bodies and components in Fusion 360! Assemble, build, and capture motion properly!...
Read more >
Layout Components - Gatsby
In this guide, you'll learn Gatsby's approach to layouts, how to create and use layout components, and how to prevent layout components from...
Read more >
Ultimate React Router v6 Guide
React Router is by far the most popular routing library in React and this article goes in depth on everything you need to...
Read more >
Naming components and hierarchy - Storybook - JS.ORG
Storybook is a frontend workshop for building UI components and pages in ... the top-level grouping will be displayed as a “root” in...
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