Skip to content

Commit

Permalink
fix: typo and improved example in latest ADR (#8063)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek authored Sep 19, 2024
1 parent 9596945 commit aa7757a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion website/docs/contributing/ADRs/front-end/jsx-conditionals.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ Nested ternaries are easier to spot than nested `<ConditionallyRender />` elemen
</div>
```

Nested operator does not look like other JSX components.

```tsx
<div>
{a ? (
b ? <p>This is bad</p> : null
) : 'Should be refactored'}
</div>
```

## Options considered

To avoid these issues, safer alternatives to the `&&` operator can be used:
Expand Down Expand Up @@ -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 `<ConditionallyRender />` have been refactored, remove the component from the codebase.
4. Once all instances of `<ConditionallyRender />` have been refactored, remove the component from the codebase.

0 comments on commit aa7757a

Please sign in to comment.