yew/packages/yew-macro/tests/hook_macro/use_transitive_state-fail.rs
Muhammad Hamza 42e1890f03
Update signature of use_prepared_state/use_transitive_state (#3376)
* Update signature of use_prepared_state

* Update signature of use_transitive_state

* Migration guide + example

* bless trybuild tests

* please fmt

* there's one usage here as well

* use_prepared_state_with_suspension needs updates

* updated tests
2023-08-19 21:58:36 +09:00

35 lines
915 B
Rust

use yew::prelude::*;
use yew_macro::{use_transitive_state_with_closure, use_transitive_state_without_closure};
#[function_component]
fn Comp() -> HtmlResult {
use_transitive_state_with_closure!(123)?;
use_transitive_state_with_closure!(|_| { todo!() }, 123)?;
use_transitive_state_with_closure!(123, |_| { todo!() })?;
use_transitive_state_with_closure!(|_| -> u32 { todo!() })?;
use_transitive_state_with_closure!(|_| -> u32 { todo!() }, 123)?;
Ok(Html::default())
}
#[function_component]
fn Comp2() -> HtmlResult {
use_transitive_state_without_closure!(123)?;
use_transitive_state_without_closure!(|_| { todo!() }, 123)?;
use_transitive_state_without_closure!(123, |_| { todo!() })?;
use_transitive_state_without_closure!(|_| -> u32 { todo!() })?;
use_transitive_state_without_closure!(|_| -> u32 { todo!() }, 123)?;
Ok(Html::default())
}
fn main() {}