Muhammad Hamza 73b5f6b4c1
Allow function_component creation based on function name (#2292)
* function_component without name

* fmt

* fc

* update docs

* remove fc
2021-12-23 13:30:17 +01:00

22 lines
283 B
Rust

use yew::prelude::*;
#[derive(Clone, Properties, PartialEq)]
struct Props {
a: usize,
}
#[function_component]
fn Comp(props: &Props) -> Html {
html! {
<p>
{ props.a }
</p>
}
}
fn main() {
let _ = html! {
<Comp a={0} />
};
}