From aa7757a2d18fb98bac921c201319727061fc4358 Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:44:16 +0200 Subject: [PATCH] fix: typo and improved example in latest ADR (#8063) https://github.com/Unleash/unleash/pull/8025#discussion_r1740561994 --- .../contributing/ADRs/front-end/jsx-conditionals.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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.