pub fn any<'a, T>(view: impl AnyView<T> + 'a) -> Box<dyn AnyView<T> + 'a>Expand description
Create a new BoxedView.
This is useful for when you need to create a view that needs to change its type dynamically.
ⓘ
// this will fail to compile because the type of each branch is different
fn ui(data: &mut bool) -> impl View<bool> {
    if *data {
        button(text("True"))
    } else {
        text("False")
    }
}// whereas this will compile using `any`
fn ui(data: &mut bool) -> impl View<bool> {
    if *data {
        any(button(text("True")))
    } else {
        any(text("False"))
    }
}