Skip to content

Commit a12dec9

Browse files
Andrew Scheuermannljharb
Andrew Scheuermann
authored andcommitted
[guide] [react] boolean in jsx alignment
1 parent b6a268f commit a12dec9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

react/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,25 @@ This style guide is mostly based on the standards that are currently prevalent i
193193
>
194194
<Quux />
195195
</Foo>
196+
197+
// bad
198+
{showButton &&
199+
<Button />
200+
}
201+
202+
// bad
203+
{
204+
showButton &&
205+
<Button />
206+
}
207+
208+
// good
209+
{showButton && (
210+
<Button />
211+
)}
212+
213+
// good
214+
{showButton && <Button />}
196215
```
197216

198217
## Quotes

0 commit comments

Comments
 (0)