Replies: 1 comment
-
You don't provide any example code, unfortunately. (And could you please use the issue template, or open a Discussion, in the future?) Your assumption is incorrect, depending on how you are reading from For what it's worth you're also looking at the output in debug mode, which is intentionally verbose (marking boundaries around different components with comment markers.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using
#[prop(into)] prop: MaybeSignal<...>
heavily in all of my components, to allow call sites to choose whether to pass in a signal or a reactive value. I'm using this even for props for which a call site will most likely choose static values, e.g. styling, color, button text, ...My assumption is that, because i use
MaybeSignal
and notSignal
, there is no performance downside to using it instead of taking a prop by value, so I can just as well make everythingMaybeSignal
and give the call site flexibility, even if it's not needed.However, I just noticed that there is actually a difference in the generated HTML.
MaybeSignal
, if added to aview!{}
, seems to create html comments with<DynChild>
tags around its content, even if it'sMaybeSignal::Static
.I'm not fully sure what
<DynChild>
does and if it has any impact on hydration or performance. But even if it doesn't, it would probably be cleaner to not generate those forMaybeSignal::Static
and only generate them forMaybeSignal::Dynamic
.Beta Was this translation helpful? Give feedback.
All reactions