Skip to content

Commit

Permalink
added a test for converting value into Some(value) in the html! macro
Browse files Browse the repository at this point in the history
  • Loading branch information
its-the-shrimp committed Sep 9, 2023
1 parent 7997d85 commit 471f259
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/yew-macro/tests/derive_props/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,25 @@ mod raw_field_names {
r#true: u32,
r#pointless_raw_name: u32,
}
}

mod value_into_some_value_in_props {
#[derive(::std::cmp::PartialEq, ::yew::Properties)]
struct Props {
field1: ::std::option::Option<usize>,
#[prop_or_default]
field2: ::std::option::Option<usize>
}

#[::yew::function_component]
fn Inner(_props: &Props) -> ::yew::html::Html {
::yew::html!{}
}

#[::yew::function_component]
fn Main() -> ::yew::html::Html {
::yew::html! { <Inner field1=3 field2=5/> }
}
}

fn main() {}

0 comments on commit 471f259

Please sign in to comment.