Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typo and improved example in latest ADR #8063

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading