Skip to content

When to use Owned vs Borrowed props? #1879

Answered by ealmloff
sekoyo asked this question in Q&A
Discussion options

You must be logged in to vote

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.

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 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sekoyo
Comment options

Answer selected by sekoyo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants