Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: impl IntoView for Rc<dyn Fn() -> impl IntoView> #1698

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

Baptistemontan
Copy link
Contributor

While moving to v0.5.0-rc1 for one of my project I realised I made a mistake with #1669, there is a IntoView impl for Fn() -> impl IntoView but it does not affect Rc<dyn Fn() -> impl IntoView>, so ChildrenFn does not impl IntoView anymore.

// works
let children: Children = ...;
view! { <b>{children}</b> };

// works
let children_mut: ChildrenFnMut = ...;
view! { <b>{children}</b> };

// fail
let children_fn: ChildrenFn = ...;
view! { <b>{children}</b> };
// need to call it to make it work:
view! { <b>{children()}</b>

This PR add a IntoView impl for Rc<dyn Fn() -> impl IntoView>

@Baptistemontan Baptistemontan changed the title impl IntoView for Rc<dyn Fn() -> impl IntoView> fix: impl IntoView for Rc<dyn Fn() -> impl IntoView> Sep 12, 2023
@gbj gbj merged commit 8d690ac into leptos-rs:main Sep 13, 2023
55 checks passed
@gbj
Copy link
Collaborator

gbj commented Sep 13, 2023

Thanks!

@Baptistemontan Baptistemontan deleted the impl_intoview_childrenfn branch September 17, 2023 19:50
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.

2 participants