You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/strict-logical-expressions.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,8 @@
2
2
3
3
Forbids the usage of potentially falsey string or number values in logical && expressions.
4
4
Oftentimes, these logical expressions are used in jsx to enable conditional rendering behavior.
5
-
However, one can encounter unexpected behavior when a 0 or empty string values is used as the left side of an expression and is returned as the result of the expression.
5
+
6
+
However, one can encounter unexpected behavior when a 0 or empty string values is returned as the result of the expression and rendered accidentally.
6
7
7
8
## Rule Details
8
9
@@ -58,6 +59,7 @@ defaultOptions: [
58
59
59
60
## Further Reading
60
61
62
+
-[React docs on conditional rendering](https://reactjs.org/docs/conditional-rendering.html#inline-if-with-logical--operator)
61
63
-[Conditional rendering in React Native may crash your app](https://koprowski.it/2020/conditional-rendering-react-native-text-crash/)
0 commit comments