1 unstable release
0.1.0 | Jan 6, 2020 |
---|
#1800 in #web
70KB
2K
SLoC
This crate provides Yew's procedural macro html!
which allows using JSX-like syntax
for generating html and the Properties
derive macro for deriving the Properties
trait
for components.
The html!
macro uses proc_macro_hack in order
to be used in the expression position.
use meet::prelude::*;
struct Component {
link: ComponentLink<Self>,
}
#[derive(Clone, Properties)]
struct Props {
#[props(required)]
prop: String,
};
#
#
#
#
// ...
html! {
<div>
<button onclick=self.link.callback(|_| Msg::Submit)>
{ "Submit" }
</button>
<>
<Component prop="first" />
<Component prop="second" />
</>
</div>
}
#
#
Dependencies
~1.5MB
~37K SLoC