Skip to content
Discussion options

You must be logged in to vote

Sorry, for the wrong in docs.

 let state = cx.new(|cx| {
            SelectState::new(
                vec!["Apple", "Orange", "Banana"],
                Some(IndexPath::default()),
                window,
                cx,
            )
        }); // <-- THIS IS FROM THE DOCS

This is not correct, render method will drop the state after call, you must store the state in HelloWorld struct.

struct HelloWorld {
    state: Entity<SelectState>,
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@huacnlee
Comment options

@l0uisgrange
Comment options

Answer selected by l0uisgrange
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