diff --git a/website/docs/contributing/ADRs/front-end/jsx-conditionals.md b/website/docs/contributing/ADRs/front-end/jsx-conditionals.md index 9fb3e3cc5f..b17f0cc51c 100644 --- a/website/docs/contributing/ADRs/front-end/jsx-conditionals.md +++ b/website/docs/contributing/ADRs/front-end/jsx-conditionals.md @@ -67,6 +67,16 @@ Nested ternaries are easier to spot than nested `` elemen ``` +Nested operator does not look like other JSX components. + +```tsx +
+ {a ? ( + b ?

This is bad

: null + ) : 'Should be refactored'} +
+``` + ## Options considered To avoid these issues, safer alternatives to the `&&` operator can be used: @@ -118,4 +128,4 @@ There already is a script developed that can convert files between `Conditionall 4. More complex and critical pages, like strategy editing. 5. Utilities and components used in many places (`/src/component/common`). -3. Once all instances of `` have been refactored, remove the component from the codebase. +4. Once all instances of `` have been refactored, remove the component from the codebase.