Replies: 2 comments 2 replies
-
If I understand correctly, Sycamore adds a special extra syntax of "wrap something in parentheses for it to be reactive." If you look at your code example, you'll see that the thing that's wrapped in a closure in Leptos is wrapped in parentheses in Sycamore. The "needing to wrap in a If you use Discord, we do have a Discord server (see link in the Readme). I do read the Rust Reddit occasionally but won't see help requests like this on Reddit. |
Beta Was this translation helpful? Give feedback.
-
Yeah, that's what I figured, thanks for confirming. I guess my question was if Leptos can simplify the syntax like Sycamore does so we don't need to use closures to get reactivity. IMO it gets a bit tedious and busy if we need closures just to identify a reactive section. Just a thought and suggestion, I like Leptos and wanted to give input as a dev. I may also be able to help out with this or other features a bit, I think you have a great thing going here with a lot of potential. I'll definitely try out the 0.1 alpha. |
Beta Was this translation helpful? Give feedback.
-
Guys, thanks for Leptos, I think it's evolving into a great framework option for Rust folks. I'm currently re-doing an app and trying to decide between Sycamore and Leptos. I prefer Leptos (seemingly better performance, JSX syntax, no lifetime/pointers for signals, props without having explicitly define them as struct, etc.). However, there is one feature of Sycamore that seems cleaner, and that WRT reactivity is using just the signal rather than having to use closures. I'm brand new to both, so could you please confirm I must use closures if I want reactivity, like in the example below? If yes, is it possible for you to remove that requirement because that would improve the dev experience? I also posted this in Reddit. Thanks!
Oh, also, why do we need that extra div to enclose the code snippet? I don't need it in Sycamore, but if I remove it in Leptos, I get an error. Could you be newbie error though.
Leptos version
Sycamore version
Beta Was this translation helpful? Give feedback.
All reactions