How to use the error
prop for ActionForm
and Form
#1230
-
I see in the docs for #[component]
pub fn Login(cx: Scope, action: Action<Login, Result<(), ServerFnError>>) -> impl IntoView {
let error = create_rw_signal(cx, None);
view! {
cx,
<ActionForm action=action error=error>
...
</ActionForm>
<p>{move || error.get()}</p>
}
} I am trying to call a server function to log the user in. If there is an error message returned from the server, I would like to display that, e.g. "User does not exist" or "Incorrect password". But, when I try read the value from the signal,
and
So my question is, if we can't call EDIT: Just to add: I understand that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can't call |
Beta Was this translation helpful? Give feedback.
You can't call
.get()
because aBox<dyn Error>
isn'tClone
. You can, however, use.with()
.