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.

Multiple choo components on a page

See original GitHub issue

Just was futzing around with testing and realized that since choo controls it’s domain via the addition of #choo-root on the element and the fact that everything is initialized and kept in the choo closure, it makes it impossible to have more than one choo component per page.

IMO it would be ideal if you could create multiple choo-owned objects per page, each with their own model and part of the DOM (you could add a data attribute with a randomized id and move choo into a “factory” of sorts (either through new or returning an Object.create etc)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
toddselfcommented, Jun 19, 2016

#52 resolves the final question in this thread 😃

0reactions
toddselfcommented, Jun 19, 2016

Ah!

Upon closer inspection, you need to do:

const app1 = choo()
const app2 = choo()
app1.start({name: 'app1'})
app2.start({name: 'app2'})

Passing in just the string as the name does not work there, but it might be more discoverable if it did? Or perhaps it should be an argument when you’re invoking choo like @timwis has in his example?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discussion: choo/component · Issue #593 · choojs/choo - GitHub
These wrappers seem to be mostly focused on two things: Manage component instances. Remove boilerplate involved with create a component.
Read more >
Full React Tutorial #5 - Multiple Components - YouTube
Hey gang, in this React tutorial we'll see how to add additional components to our React application (a navbar component and a homepage ......
Read more >
Fun Functional Programming with the Choo Framework
With the aid of seven comprehensive demos, Mark Brown introduces you to Choo — a fun new framework for building single page apps...
Read more >
Building a basic landing page with React | by Ming Sheng Choo
So our main goal is to create a website that has 3 pages, main page/Home page, About Us Page, and Contact Us Page....
Read more >
User Manual - MCLAB
Choo -Choo Cloning™ is a highly efficient directional PCR cloning kit designed for rapid cloning of one or multiple. PCR fragments without the...
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