From b74e53c3ca730f1997dbfb53555348aeaa6db2ee Mon Sep 17 00:00:00 2001 From: Kale Date: Mon, 23 Nov 2015 06:38:08 -0700 Subject: [PATCH] Use null instead of '' in ternary expression A blank string ('') resolves to which produces a warning when place inside a --- docs/tips/03-if-else-in-JSX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tips/03-if-else-in-JSX.md b/docs/tips/03-if-else-in-JSX.md index 0782b4b84a..a22a6cf818 100644 --- a/docs/tips/03-if-else-in-JSX.md +++ b/docs/tips/03-if-else-in-JSX.md @@ -30,7 +30,7 @@ React.createElement("div", {id: if (condition) { 'msg' }}, "Hello World!"); That's not valid JS. You probably want to make use of a ternary expression: ```js -ReactDOM.render(
Hello World!
, mountNode); +ReactDOM.render(
Hello World!
, mountNode); ``` If a ternary expression isn't robust enough, you can use `if` statements outside of your JSX to determine which components should be used: