-
Dioxus looks great, but this part of the docs is a bit concerning to me: I must make the decision between copying, or definitely causing render reconciliation (which could become worse over time as the render tree grows). It would be great in this section to have some advice on when to use one or the other. I'm also surprised that there isn't a mention of a This is what makes Solid style observables more appealing to me: I don't need to make this difficult decision, and while Dioxus has very impressive benchmarks (higher than Leptos) and a very impressive production bundle size (again multiple times smaller), I'm concerned that it won't scale as linearly as observables would while also placing this tricky architectural burden on users. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The docs explain it in this section: Borrowed props can be very useful, but they do not allow for memorization so they will always rerun when the parent scope is rerendered. Because of this Borrowed Props should be reserved for components that are cheap to rerun or places where cloning data is an issue. Using Borrowed Props everywhere will result in large parts of your app rerunning every interaction.
In dioxus, components are memo by default. Borrowed props opt out of memo. If you want to opt out of memo for non-borrowed props, you can implement partialeq as always false for your props struct
As far as I know in leptos and the newest version of sycamore, you always need to clone or move props into children. You don't have the option of borrowed props. That said, we have been exploring different state management systems in dioxus. Dioxus-signals was released in 0.4.3. It provides |
Beta Was this translation helpful? Give feedback.
The docs explain it in this section: Borrowed props can be very useful, but they do not allow for memorization so they will always rerun when the parent scope is rerendered. Because of this Borrowed Props should be reserved for components that are cheap to rerun or places where cloning data is an issue. Using Borrowed Props everywhere will result in large parts of your app rerunning …