Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child components aren't mounted if the document root is another HTML tag than used in the root component #116

Open
fbring opened this issue Apr 15, 2019 · 0 comments

Comments

@fbring
Copy link
Contributor

fbring commented Apr 15, 2019

Explain the problem

Child components aren't mounted if the document root in the HTML file uses another HTML tag than the root component.

Example:

<!-- index.html -->

<body>
   <div id="root"></div>
</body>
<!-- rootComponent.twig -->

<section>
   <h1>I am root 🌳</h1>
   {% mount '../childComponent' as 'childComponent' %}
</section>
// index.js

const documentRoot = document.getElementById('root');
render(documentRoot, rootComponent);

Expected Behaviour

I would expect that the child components are mounted properly or a warning/error should be shown.

Actual Behaviour

The root component renders as expected but instead of mounting the child component a <m-placeholder></m-placeholder> is rendered.

Steps to reproduce

  1. Use Create Melody App
  2. Change the outer <div class="home">...</div> in src/home/index.twig to something else e.g.
    <section class="home">...</section>
  3. src/counter is not mounted

Provide your Environment details

  • melody version: 1.2.0-21.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant