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
I guess it's just syntax sugar that will be compiled into styled dummy div at compile time. Elderjs replaces the entire client component with something else when compiling hence the directive doesn't work. Passing it as a real component prop does not work either since it's not a real prop but template syntax.
The text was updated successfully, but these errors were encountered:
@eight04 You nailed one of the drawbacks with partial hydration and this is related to #237.
Basically each component is an island so we can't fully support all of Svelte's functionality out of the box... but you can get what you are trying to achieve by wrapping sub components in a hydrated component.
Open to a PR for this if you'd like to add and document this.
The concern here is expanding scope of trying to match Svelte's offerings and adding more complexity to the preprocessing stage when our business case doesn't need this functionality. (we just hydrate a sub component)
Basically it is a decision against complexity and maintenance burden. Would be a nice to have though.
Here is the repro:
https://github.com/eight04/node-test/tree/elderjs-style-prop
Svelte allows you to pass css custom property to components via
--prop=value
syntax:https://svelte.dev/docs#template-syntax-component-directives---style-props
However it doesn't work with client components:
Result in:
I guess it's just syntax sugar that will be compiled into styled dummy div at compile time. Elderjs replaces the entire client component with something else when compiling hence the directive doesn't work. Passing it as a real component prop does not work either since it's not a real prop but template syntax.
The text was updated successfully, but these errors were encountered: