diff --git a/README.md b/README.md index 1cb5bbb83..dc834ce68 100644 --- a/README.md +++ b/README.md @@ -268,64 +268,20 @@ Tauri is a framework for building desktop mobile apps where your frontend is wri Leptos is a library for building fullstack web-apps, similar to SolidJS and SolidStart. The two libraries share similar goals on the web, but have several key differences: -- **Reactivity model**: Leptos uses signals for its underlying reactivity, while Dioxus opts for a VirtualDom and re-renders. While in theory signals are more efficient, in practice, Dioxus' VirtualDom performs little-to-no actual diffing (thanks to our [block-dom inspired templates](https://dioxuslabs.com/blog/templates-diffing)) and is [actually faster than Leptos](https://krausest.github.io/js-framework-benchmark/2024/table_chrome_123.0.6312.59.html). +- **Reactivity model**: Leptos uses signals to drive both reactivity and rendering, while Dioxus uses signals just for reactivity. For managing re-renders, Dioxus uses a highly optimized VirtualDOM to support desktop and mobile architectures. Both Dioxus and Leptos are extremely fast. -- **Control flow**: Because Leptos uses signals for reactivity, you are constrained to Leptos' primitives for things like `for` loops and `if` statements. If you get this wrong, your app will lose reactivity, leading to hard to debug UI issues. With Dioxus, you can use iterators, regular Rust `for` loops and `if` statements, and your app will still be reactive. In practice, a Dioxus component to insert counters into a list might look like this: +- **Different scopes**: Dioxus provides renderers for web, desktop, mobile, LiveView, and more. We also maintain community libraries and a cross-platform SDK. Leptos has a tighter focus on the fullstack web with features that Dioxus doesn't have like islands, `
` components, and other web-specific utilities. -```rust -fn Counters() -> Element { - let mut counters = use_signal(|| vec![0; 10]); - - rsx! { - button { onclick: move |_| counters.push(counters.len()), "Add Counter" } - ul { - for idx in 0..counters.len() { - li { - button { onclick: move |_| counters.write()[idx] += 1, "{counters.index(idx)}" } - button { onclick: move |_| { counters.remove(idx); }, "Remove" } - } - } - } - } -} -``` - -[While in Leptos you would use the `