mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Remove unnecessary macro test helper (#825)
This commit is contained in:
parent
75c93a889a
commit
88374c7993
@ -1,24 +0,0 @@
|
||||
#[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)* }
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
#[macro_use]
|
||||
mod helpers;
|
||||
use yew::prelude::*;
|
||||
|
||||
pass_helper! {
|
||||
fn compile_pass() {
|
||||
html! { <>{ "Hi" }</> };
|
||||
html! { <>{ format!("Hello") }</> };
|
||||
html! { <>{ String::from("Hello") }</> };
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
#[macro_use]
|
||||
mod helpers;
|
||||
|
||||
use yew::prelude::*;
|
||||
use yew::html::ChildrenRenderer;
|
||||
|
||||
#[derive(Properties, Default, PartialEq)]
|
||||
@ -87,7 +85,7 @@ mod scoped {
|
||||
pub use super::Container;
|
||||
}
|
||||
|
||||
pass_helper! {
|
||||
fn compile_pass() {
|
||||
html! { <Child int=1 /> };
|
||||
|
||||
// backwards compat
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
#[macro_use]
|
||||
mod helpers;
|
||||
|
||||
use yew::prelude::*;
|
||||
use std::iter;
|
||||
|
||||
pass_helper! {
|
||||
fn compile_pass() {
|
||||
html! { for iter::empty::<Html>() };
|
||||
html! { for Vec::<Html>::new().into_iter() };
|
||||
html! { for (0..3).map(|num| { html! { <span>{num}</span> } }) };
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#[macro_use]
|
||||
mod helpers;
|
||||
use yew::prelude::*;
|
||||
|
||||
pass_helper! {
|
||||
fn compile_pass() {
|
||||
html! {};
|
||||
html! { <></> };
|
||||
html! {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#[macro_use]
|
||||
mod helpers;
|
||||
use yew::prelude::*;
|
||||
|
||||
pass_helper! {
|
||||
fn compile_pass() {
|
||||
html! { "" };
|
||||
html! { 'a' };
|
||||
html! { "hello" };
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
#![recursion_limit = "512"]
|
||||
use yew::prelude::*;
|
||||
|
||||
#[macro_use]
|
||||
mod helpers;
|
||||
|
||||
pass_helper! {
|
||||
fn compile_pass() {
|
||||
let onclick = Callback::from(|_: ClickEvent| ());
|
||||
let parent_ref = NodeRef::default();
|
||||
html! {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user