Skip to content

Commit a24dc34

Browse files
heyitakiljharb
authored andcommitted
[guide] [react] Add examples for formatting multiline conditional components
1 parent 1dc71d3 commit a24dc34

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

react/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,27 @@ This style guide is mostly based on the standards that are currently prevalent i
214214
215215
// good
216216
{showButton && <Button />}
217+
218+
// good
219+
{someReallyLongConditional
220+
&& anotherLongConditional
221+
&& (
222+
<Foo
223+
superLongParam="bar"
224+
anotherSuperLongParam="baz"
225+
/>
226+
)
227+
}
228+
229+
// good
230+
{someConditional ? (
231+
<Foo />
232+
) : (
233+
<Foo
234+
superLongParam="bar"
235+
anotherSuperLongParam="baz"
236+
/>
237+
)}
217238
```
218239

219240
## Quotes

0 commit comments

Comments
 (0)