mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* Fix Call Generics & FnOnce macro hygiene. * Add a failure case as well. * Remove a unused struct in test case. * Update packages/yew-macro/tests/hook_attr/hook-const-generic-pass.rs Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
40 lines
672 B
Rust
40 lines
672 B
Rust
use yew::prelude::*;
|
|
|
|
#[derive(Debug, PartialEq, Clone)]
|
|
struct Ctx;
|
|
|
|
#[hook]
|
|
fn use_some_html() -> Html {
|
|
if let Some(_m) = use_context::<Ctx>() {
|
|
use_context::<Ctx>().unwrap();
|
|
todo!()
|
|
}
|
|
|
|
let _ = || {
|
|
use_context::<Ctx>().unwrap();
|
|
todo!()
|
|
};
|
|
|
|
for _ in 0..10 {
|
|
use_context::<Ctx>().unwrap();
|
|
}
|
|
|
|
while let Some(_m) = use_context::<Ctx>() {
|
|
use_context::<Ctx>().unwrap();
|
|
}
|
|
|
|
match use_context::<Ctx>() {
|
|
Some(_) => use_context::<Ctx>(),
|
|
None => {
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
loop {
|
|
use_context::<Ctx>().unwrap();
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
fn main() {}
|