Skip to content

Commit

Permalink
Forgot to update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton committed Nov 5, 2023
1 parent a1c7fb3 commit 0fc2002
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ No more extra one-off Props structs!
# Examples

```rust
use yew_autoprops::autoprops_component;
use yew_autoprops::autoprops;
use yew::prelude::*;

#[autoprops_component]
#[autoprops]
#[function_component]
fn CoolComponent(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
html! {
<div class={classes!(hidden.then_some("hidden"))}>
Expand All @@ -24,10 +25,11 @@ fn CoolComponent(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
```

```rust
use yew_autoprops::autoprops_component;
use yew_autoprops::autoprops;
use yew::prelude::*;

#[autoprops_component(CoolComponent)]
#[autoprops(CoolComponentProps)]
#[function_component(CoolComponent)]
fn cool_component(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
html! {
<div class={classes!(hidden.then_some("hidden"))}>
Expand Down

0 comments on commit 0fc2002

Please sign in to comment.