Skip to content

using <Await> with also reactive server actions #2521

Answered by gbj
caligin asked this question in Q&A
Discussion options

You must be logged in to vote

Here's a working version of these lines:

<ActionForm action=save_fields
  // clones `initial_data` before moving it into the children of `ActionForm`
  clone:initial_data
>
    <input
        type="text"
        prop:value=move || {
            let existing_data = initial_data
                // clones `initial_data` so it can be used to update this value multiple times
                .clone()

Here's another approach to the same kind of thing without needing to clone the value like that. I'm not sure this actually works as you're intending but hopefully you can see the point!

#[component]
fn HomePage() -> impl IntoView {
    let save_fields = create_server_action::<SaveFields>();
    let…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@caligin
Comment options

@caligin
Comment options

@gbj
Comment options

@caligin
Comment options

Answer selected by caligin
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