Search code examples
javascriptractivejs

Multiple Ractive components


At the moment it is not possible to use more then one component in a template. For example:

<div class='wrapper'>
  <LeftColumn>
  <RightColumn>
  <p>text here</p>
</div>

Ractive displays only the first one. The situation is the same if I want to use same component tag twice. It's even more strange when I have only one component but place something after the tag (the <p>text here</p> above). It is not displayed too. Here is a JSBin showing the problem http://jsbin.com/maxen/3/edit?html,js,output


Solution

  • You need to either add closing </widget> tag or use self-closing syntax - <widget />. Demo here.