Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton committed Oct 30, 2023
1 parent c03393d commit c3bcde7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ use yew_autoprops::autoprops_component;
use yew::prelude::*;

#[autoprops_component]
fn CoolComponent(#[prop_or_default] test: &i8, smth: &usize) -> Html {
println!("test: {}", test);

fn CoolComponent(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
html! {
<div>
<div class={classes!(hidden.then_some("hidden"))}>
<p>{ smth }</p>
</div>
}
Expand All @@ -30,11 +28,9 @@ use yew_autoprops::autoprops_component;
use yew::prelude::*;

#[autoprops_component(CoolComponent)]
fn cool_component(#[prop_or_default] test: &i8, smth: &usize) -> Html {
println!("test: {}", test);

fn cool_component(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
html! {
<div>
<div class={classes!(hidden.then_some("hidden"))}>
<p>{ smth }</p>
</div>
}
Expand Down
12 changes: 4 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
//! use yew::prelude::*;
//!
//! #[autoprops_component]
//! fn CoolComponent(#[prop_or_default] test: &i8, smth: &usize) -> Html {
//! println!("test: {}", test);
//!
//! fn CoolComponent(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
//! html! {
//! <div>
//! <div class={classes!(hidden.then_some("hidden"))}>
//! <p>{ smth }</p>
//! </div>
//! }
Expand All @@ -26,11 +24,9 @@
//! use yew::prelude::*;
//!
//! #[autoprops_component(CoolComponent)]
//! fn cool_component(#[prop_or_default] test: &i8, smth: &usize) -> Html {
//! println!("test: {}", test);
//!
//! fn cool_component(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
//! html! {
//! <div>
//! <div class={classes!(hidden.then_some("hidden"))}>
//! <p>{ smth }</p>
//! </div>
//! }
Expand Down

0 comments on commit c3bcde7

Please sign in to comment.