yew/tests/macro/helpers.rs
Justin Starry f61667be97
Remove generics from virtual dom (#783)
* Fix tests

* Remove generics from virtual dom

* Prep for degenerify

* Fix examples

* Remove props cloning

* Fix tests
2019-12-08 10:47:51 -08:00

25 lines
666 B
Rust

#[macro_export]
macro_rules! pass_helper {
( @html ) => { html! {} };
( @html html! { $($view:tt)* }; $($tail:tt)* ) => {
html! { $($view)* };
pass_helper! { @ html $($tail)* }
};
( @html $head:stmt; $($tail:tt)* ) => {
$head
pass_helper! { @ html $($tail)* }
};
( $($content:tt)* ) => {
mod test_component;
use yew::prelude::*;
#[allow(unused)]
use test_component::TestComponent;
struct SubComponent;
impl Renderable for SubComponent {
fn render(&self) -> Html {
pass_helper! { @ html $($content)* }
}
}
};
}