From d1e8b526aee0d0cac5e25690f1a6b7db23ebfe1d Mon Sep 17 00:00:00 2001 From: Michael H Date: Tue, 13 Mar 2018 22:06:46 -0700 Subject: [PATCH] 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 5680ee212..2112eed1d 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 (