From d1e8b526aee0d0cac5e25690f1a6b7db23ebfe1d Mon Sep 17 00:00:00 2001 From: Michael H Date: Tue, 13 Mar 2018 22:06:46 -0700 Subject: [PATCH 1/2] Adds Ternary Operator to Make Example Concise Issue #657 --- content/docs/conditional-rendering.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/content/docs/conditional-rendering.md b/content/docs/conditional-rendering.md index 5680ee21..2112eed1 100644 --- a/content/docs/conditional-rendering.md +++ b/content/docs/conditional-rendering.md @@ -93,12 +93,9 @@ class LoginControl extends React.Component { render() { const isLoggedIn = this.state.isLoggedIn; - let button = null; - if (isLoggedIn) { - button = ; - } else { - button = ; - } + let button = isLoggedIn + ? + : ; return (
From a2e445b85bdd20a80ba067921066213dbeec0f98 Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Tue, 13 Mar 2018 22:19:00 -0700 Subject: [PATCH 2/2] Prettier --- content/docs/conditional-rendering.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/content/docs/conditional-rendering.md b/content/docs/conditional-rendering.md index 2112eed1..d858dbb6 100644 --- a/content/docs/conditional-rendering.md +++ b/content/docs/conditional-rendering.md @@ -92,10 +92,12 @@ class LoginControl extends React.Component { render() { const isLoggedIn = this.state.isLoggedIn; - - let button = isLoggedIn - ? - : ; + + let button = isLoggedIn ? ( + + ) : ( + + ); return (