Skip to content

Commit e88ddaa

Browse files
minsoo-webraon0211
authored andcommitted
update ternary operator docs with no useMemo (#38)
1 parent ef8009a commit e88ddaa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

code/examples/ternary-operator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const status = A조건 && B조건 ? "BOTH" : 둘다아닌경우 ? "NONE" : A조
2525
다음과 같이 조건을 `if` 문으로 풀어서 사용하면 보다 명확하고 간단하게 조건을 드러낼 수 있어요.
2626

2727
```typescript
28-
const status = useMemo(() => {
28+
const status = (() => {
2929
if (A조건 && B조건) {
3030
return "BOTH";
3131
}
@@ -35,5 +35,5 @@ const status = useMemo(() => {
3535
}
3636

3737
return "NONE";
38-
}, [A조건, B조건]);
38+
}, [A조건, B조건])();
3939
```

en/code/examples/ternary-operator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This code uses multiple nested ternary operators, making it difficult to quickly
2525
You can rewrite the conditions using `if` statements, as shown below, to make the logic clearer and easier to follow.
2626

2727
```typescript
28-
const status = useMemo(() => {
28+
const status = (() => {
2929
if (ACondition && BCondition) {
3030
return "BOTH";
3131
}
@@ -35,5 +35,5 @@ const status = useMemo(() => {
3535
}
3636

3737
return "NONE";
38-
}, [ACondition, BCondition]);
38+
}, [ACondition, BCondition])();
3939
```

0 commit comments

Comments
 (0)