You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the docs site, when the Layout components wraps a content component (built from mdx), the content does render, but if the content has a child component it doesn't render.
it.only('should render nested component when it is projected by parent',async()=>{constLayout=component$(()=>{return$(()=>(<div><Slot/></div>));},{tagName: 'layout'});constContent=component$(()=>{return$(()=>(<span><Slot/></span>));},{tagName: `content`});awaitrender(fixture.host,<Layout><Content>projection</Content></Layout>
);console.log(prettyHtml(fixture.host));expectRendered(<layout><template/><div><q:slot><content><template/><span><q:slot>projection</q:slot></span></content></q:slot></div></layout>);});
the issue is that if you have two components the slot projection ends up in the inert <template> rather than inside of inner component. A quick look I suspect that cursorForComponent is not being called for the inner component. The purpose of the cursor is to abstract away the slot projection, and somehow in this case it is failing.
In the docs site, when the Layout components wraps a content component (built from mdx), the content does render, but if the content has a child component it doesn't render.
Main component: https://github.com/BuilderIO/qwik/blob/844a1b2c03bdb685dfb4e11cc7e48c83e1e170a1/docs/site/src/main.tsx#L18-L20
Layout component w/ Slot:
https://github.com/BuilderIO/qwik/blob/844a1b2c03bdb685dfb4e11cc7e48c83e1e170a1/docs/site/src/layouts/docs/docs.tsx#L25
The bootstrap.mdx file has a
<Counter/>
component: https://github.com/BuilderIO/qwik/blob/844a1b2c03bdb685dfb4e11cc7e48c83e1e170a1/docs/guide/bootstrap.mdxThe counter component works when not using slot and wiring up the bootstrap component directly.
The text was updated successfully, but these errors were encountered: