From 4d6329a75543229cfad1af1a333dfc145a084d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20von=20Hohenb=C3=BChel?= <37049489+Maximilian-v-H@users.noreply.github.com> Date: Sun, 12 Jun 2022 16:13:47 +0200 Subject: [PATCH] Update introduction.mdx (#2730) * Update introduction.mdx The `if else` example was syntactically correct, but had a semantic issue of not using the condition variable. Could lead to confusion if you are a newbie. * Update conditional-rendering.mdx changed if condition variable in html docs --- website/docs/concepts/html/conditional-rendering.mdx | 2 +- .../version-0.19.0/concepts/html/introduction.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/concepts/html/conditional-rendering.mdx b/website/docs/concepts/html/conditional-rendering.mdx index e74ad79c1..6e5bfaae4 100644 --- a/website/docs/concepts/html/conditional-rendering.mdx +++ b/website/docs/concepts/html/conditional-rendering.mdx @@ -31,7 +31,7 @@ use yew::prelude::*; let some_condition = true; html! { - if false { + if some_condition {
{ "True case" }
} else {{ "False case" }
diff --git a/website/versioned_docs/version-0.19.0/concepts/html/introduction.mdx b/website/versioned_docs/version-0.19.0/concepts/html/introduction.mdx index 512d46d83..f5ca1d858 100644 --- a/website/versioned_docs/version-0.19.0/concepts/html/introduction.mdx +++ b/website/versioned_docs/version-0.19.0/concepts/html/introduction.mdx @@ -189,7 +189,7 @@ use yew::html; let some_condition = true; html! { - if false { + if some_condition {{ "True case" }
} else {{ "False case" }