mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* Add no_implicit_prelude to derive_props test * Add no_implicit_prelude to html_macro tests * Fix function_component macro tests function_component macro tests weren't being run by try build due to change in dir name. Imports corrected now that function_component is now in yew. Adds no_implicit_prelude to *-pass tests * Add no_implicit_prelude to props_macro tests * fix typo in comment
34 lines
576 B
Rust
34 lines
576 B
Rust
use yew::prelude::*;
|
|
|
|
#[derive(Clone, Properties, PartialEq)]
|
|
struct Props {
|
|
a: usize,
|
|
}
|
|
|
|
#[function_component(Comp)]
|
|
fn comp<P>(_props: &P) -> Html
|
|
where
|
|
P: Properties + PartialEq,
|
|
{
|
|
html! {
|
|
<p></p>
|
|
}
|
|
}
|
|
|
|
struct MissingTypeBounds;
|
|
|
|
fn compile_fail() {
|
|
// missing prop 'a'
|
|
html! { <Comp<Props> /> };
|
|
|
|
// invalid type parameter
|
|
html! { <Comp<INVALID> /> };
|
|
// parameter doesn't match bounds
|
|
html! { <Comp<MissingTypeBounds> /> };
|
|
|
|
// missing type param
|
|
html! { <Comp /> };
|
|
}
|
|
|
|
fn main() {}
|