How to display error without displaying the value? #2417
silicology1
started this conversation in
General
Replies: 1 comment
-
The way that ErrorBoundary works is by detecting whether the <ErrorBoundary
// the fallback receives a signal containing current errors
fallback=|errors| view! {
<div class="error">
<p>"Not a number! Errors: "</p>
// we can render a list of errors as strings, if we'd like
<ul>
{move || errors.get()
.into_iter()
.map(|(_, e)| view! { <li>{e.to_string()}</li>})
.collect_view()
}
</ul>
</div>
}
>
{move || value.get().map(|_| ())}
</ErrorBoundary> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here in the example error boundary
{value}
has to be displayed. How can I handle error without displaying the value?Beta Was this translation helpful? Give feedback.
All reactions