yewstack / yew-autoprops

Apache License 2.0
8 stars 1 forks source link

Main App cannot be autoprops #9

Closed kirillsemyonkin closed 10 months ago

kirillsemyonkin commented 12 months ago

For consistency reasons, I tried to write following:

#[autoprops_component]
fn App() -> Html {
    html! {}
}

This comes up with following error on a CSR render:

the function or associated item `new` exists for struct `Renderer<App>`, but its trait bounds were not satisfied
the following trait bounds were not satisfied:
`AppProps: std::default::Default`
- doesn't satisfy `AppProps: std::default::Default`
- consider annotating `AppProps` with `#[derive(Default)]`: `#[derive(Default)]`

This is probably due to fact that props struct generates for App even if there are no props (as mentioned in #7).

valyagolev commented 12 months ago

Thank you for all of the reports. To be honest, I don't use yew anymore (primarily switched to dioxus), and will unlikely tackle any of the issues myself. But you're welcome to send PRs, and I can give you commit rights too

kirillsemyonkin commented 12 months ago

I don't use yew anymore

Its all good if you still accept PRs and release new versions, otherwise consider transferring ownership

valyagolev commented 12 months ago

Its all good if you still accept PRs and release new versions,

I won't mind for now

otherwise consider transferring ownership

If anyone is interested, why not

kirillsemyonkin commented 12 months ago

If anyone is interested, why not

That would be me, @cecton, or, if possible, yewstack

cecton commented 12 months ago

I don't think it will be necessary. I will make a PR now to port the feature to Yew. If it succeeds, you will be able to archive the repository

cecton commented 11 months ago

This one is already fixed in the autoprops port on Yew