Skip to content

Commit

Permalink
Add example with embedded expression and ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed Aug 4, 2022
1 parent 3707b0a commit 9ffd3b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/rules/jsx-no-useless-fragment.md
Expand Up @@ -27,6 +27,8 @@ Examples of **incorrect** code for this rule:
<div />
</>
</section>

{showFullName ? <>{fullName}</> : <>{firstName}</>}
```

Examples of **correct** code for this rule:
Expand Down Expand Up @@ -55,6 +57,8 @@ const cat = <>meow</>
</SomeComponent>

<Fragment key={item.id}>{item.value}</Fragment>

{showFullName ? fullName : firstName}
```

### `allowExpressions`
Expand Down

0 comments on commit 9ffd3b5

Please sign in to comment.