use yew::html::ChildrenRenderer;
use yew::prelude::*;
#[derive(Clone, Properties, PartialEq)]
pub struct ChildProperties {
#[prop_or_default]
pub string: String,
pub int: i32,
}
pub struct Child;
impl Component for Child {
type Message = ();
type Properties = ChildProperties;
fn create(_ctx: &Context) -> Self {
unimplemented!()
}
fn view(&self, _ctx: &Context) -> Html {
unimplemented!()
}
}
#[derive(Clone, Properties, PartialEq)]
pub struct ChildContainerProperties {
pub children: ChildrenWithProps,
}
pub struct ChildContainer;
impl Component for ChildContainer {
type Message = ();
type Properties = ChildContainerProperties;
fn create(_ctx: &Context) -> Self {
unimplemented!()
}
fn view(&self, _ctx: &Context) -> Html {
unimplemented!()
}
}
fn compile_fail() {
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
let (p1, p2);
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { };
html! { { "Not allowed" } };
let num = 1;
html! { };
// trying to overwrite `children` on props which don't take any.
html! {
{ "please error" }
};
html! { };
html! { };
html! { { "Not allowed" } };
html! { <>> };
html! { };
// using `children` as a prop while simultaneously passing children using the syntactic sugar
let children = ChildrenRenderer::new(vec![html_nested! { }]);
html! {
};
html_nested! {
{ 1 }
{ 2 }
};
html! { };
html! { };
html! { };
}
#[derive(Clone, Properties, PartialEq)]
pub struct HtmlInPropsProperties {
pub header: ::yew::Html,
}
#[function_component]
fn HtmlInProps(props: &HtmlInPropsProperties) -> Html { let _ = (); unimplemented!() }
fn not_expressions() {
html! { };
html! { };
}
fn mismatch_closing_tags() {
pub struct A;
impl Component for A {
type Message = ();
type Properties = ();
fn create(_ctx: &Context) -> Self {
unimplemented!()
}
fn view(&self, _ctx: &Context) -> Html {
unimplemented!()
}
}
pub struct B;
impl Component for B {
type Message = ();
type Properties = ();
fn create(_ctx: &Context) -> Self {
unimplemented!()
}
fn view(&self, _ctx: &Context) -> Html {
unimplemented!()
}
}
let _ = html! { };
let _ = html! { > };
}
fn main() {}