Skip to content

Commit 8166dd1

Browse files
authored
Merge pull request #79 from selrond/patch-1
change order to improve clarity
2 parents 6ccafe0 + b95c452 commit 8166dd1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

patterns/18.conditionals-in-jsx.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ const sampleComponent = () => {
1414
};
1515
```
1616
For Complex scenarios with too many ternaries:
17-
- Best approach: Move logic to sub-components
18-
- Alternate hacky approach: Use IIFE
1917

2018
```javascript
2119
// Y soo many ternary??? :-/
@@ -34,6 +32,10 @@ const sampleComponent = () => {
3432
)
3533
};
3634
```
35+
36+
- Best approach: Move logic to sub-components
37+
- Alternate hacky approach: Use IIFE
38+
3739
There are some libraries that solve this problem (JSX-Control Statements), but rather than introduce another dependency
3840
use an [IIFE](http://stackoverflow.com/questions/8228281/what-is-the-function-construct-in-javascript) and return values by using if-else statement inside
3941

0 commit comments

Comments
 (0)