fixed use_cookie example

This commit is contained in:
Maccesch 2024-01-23 16:05:07 +00:00
parent 4598c27e29
commit 91071cf119

View file

@ -5,17 +5,11 @@ use leptos_use::use_cookie;
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
if let Some(cookie) = use_cookie("auth") { if let Some(cookie) = use_cookie("auth") {
view! { view! { <div>"'auth' cookie set to " <code>"`" {cookie.value().to_string()} "`"</code></div> }
<div> .into_view()
format!("'auth' cookie set to `{}`", cookie.value())
</div>
}.into_view()
} else { } else {
view! { view! { <div>"No 'auth' cookie set"</div> }
<div> .into_view()
"No 'auth' cookie set"
</div>
}.into_view()
} }
} }