[✨]Allow dot notation for component$ #3621
Labels
STATUS-3: works as expected
This issue is closed because the behavior is correct and expected
TYPE: enhancement
New feature or request
Is your feature request related to a problem?
Dot notation for components is generally excellent for linting.
`const Scene = () => {
...
}
Scene.Title = Title;
Scene.Setting = Setting;
Scene.Body = Body;
export default Scene;
Which allows use like this:
<Scene.Title>ACT III Scene II</Scene.Title>
<Scene.Setting>A Stormy Heath</Scene.Setting>
<Scene.Body>
Blow, winds, and crack your cheeks! rage! blow!
You cataracts and hurricanoes, spout
Till you have drench'd our steeples, drown'd the cocks!
You sulphurous and thought-executing fires,
Vaunt-couriers to oak-cleaving thunderbolts,
Singe my white head! And thou, all-shaking thunder,
Smite flat the thick rotundity o' the world!
Crack nature's moulds, an germens spill at once,
That make ingrateful man!
</Scene.Body>
`
Unfortunately this doesn't appear to work with qwik's component$
`const Scene = component$(() => {
...
});
Scene.Title = Title;
Scene.Setting = Setting;
Scene.Body = Body;
export default Scene;
`
Describe the solution you'd like
Ideally I'd like to use the above notation with component$.
The ability to limit the kind of child components to only those appended to it (as above) will also be beneficial, as this is lacking in more popular frameworks, such as React:
`const Scene = component$(() => {
...
});
Scene.Title = Title;
Scene.Setting = Setting;
Scene.Body = Body;
export default Scene;
`
In this example, only children of Scene.Title, Scene.Setting, and Scene.Body should be allowed.
This however is not necessary by any means.
Describe alternatives you've considered
No alternatives required
Additional context
No response
The text was updated successfully, but these errors were encountered: