An open API service indexing awesome lists of open source software.

https://github.com/yewstack/yew-autoprops


https://github.com/yewstack/yew-autoprops

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# yew-autoprops

Crate Info
API Docs

proc-macro to automatically derive Properties structs from args for Yew components

No more extra one-off Props structs!

# Examples

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

#[autoprops]
#[function_component]
fn CoolComponent(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
html! {


{ smth }



}
}
```

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

#[autoprops(CoolComponentProps)]
#[function_component(CoolComponent)]
fn cool_component(#[prop_or_default] hidden: bool, smth: &AttrValue) -> Html {
html! {


{ smth }



}
}
```