Skip to content
Discussion options

You must be logged in to vote

If you define a children prop that takes arguments, those arguments are provided in order by let:. It's always a little hard to know how best to document things like this, but it's perfectly fine to use it in your own components.

It's mostly useful for things that are similar to <For/> or <Await/>, where you would otherwise have a render prop that's similar to Fn(T) -> impl IntoView (as you say), but would rather keep it inline rather than breaking out of the JSX. It's hard to come up with good examples but the mechanics work as below.

#[component]
pub fn App() -> impl IntoView {
    view! {
        <TakesLet
            input="text"
            let:output
        >
            <p>{output}<…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abherer-constant
Comment options

Answer selected by abherer-constant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants