Skip to content

Commit 6ccafe0

Browse files
authored
Merge pull request #80 from cristianoliveira/patch-1
Fix conditional example missing return
2 parents 96ed82c + fe9acba commit 6ccafe0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

patterns/18.conditionals-in-jsx.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Or alternatively simply use early returns
6666
```javascript
6767
const sampleComponent = () => {
6868
const basicCondition = flag && flag2 && !flag3;
69-
if (!basicCondition) <p>Derp</p>;
69+
if (!basicCondition) return <p>Derp</p>;
7070
if (flag4) return <p>Blah</p>;
7171
if (flag5) return <p>Meh</p>;
7272
return <p>Herp</p>

0 commit comments

Comments
 (0)