Skip to content

Conversation

kirillsemyonkin
Copy link
Collaborator

Discovered by @Madoshakalaka

If a reference type is actually intended, #[autoprops] will currently ignore that and put a referenceless type into the props struct. For example:

#[autoprops]
#[component]
pub fn Test(string: &'static str) {
    html!{}
}

In this case 'static is ignored, and str is attempted to be put into props struct. As a workaround, currently works:

#[autoprops]
#[component]
pub fn Test(string: &&'static str) {
    html!{}
}

But it is unergonomic. It is well known that reference is wanted (by the lifetime specifier existing), so let's put such references into props struct as-is.

@kirillsemyonkin
Copy link
Collaborator Author

I'm not going to fix MSRV - I do not know what's the intent behind the chosen MSRV and such unspecific versions in Cargo.toml.
I had to update Cargo.lock because my latest stable did not work (something something web_sys outdated), but in doing so MSRV broke. If that's the issue, then versions should be pinned to last working ones instead of committing Cargo.lock, in which case Cargo will use both outdated lib dep for this library and updated in case someone is using another lib which uses the same dep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant