Skip to content

Can we do React-style iteration over children? #1818

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

You must be logged in to vote

There has been some discussion about a VNode iterator in this issue, but would be more complicated than react because of the structure of VNodes that enables dioxus' improved performance.

You can spread props pretty easily in the git version of dioxus. I think the API you posted is possible, but it would be much easier to support an API like this:

fn Example(cx: Scope) -> Element {
    render! {
        button {
            class: "myButton",
            ..create_trigger(),
            "Click me!"
        }
    }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danielkov
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