Skip to content

Commit 3a2711c

Browse files
authored
Split examples using markdown
1 parent d2fb6c9 commit 3a2711c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/rules/jsx-key.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ array literal or an arrow function expression.
55

66
## Rule Details
77

8-
Three different examples of **incorrect** code for this rule:
8+
Examples of **incorrect** code for this rule:
99

1010
```jsx
1111
[<Hello />, <Hello />, <Hello />];
12+
```
1213

14+
```jsx
1315
data.map(x => <Hello>{x}</Hello>);
16+
```
1417

18+
```jsx
1519
<Hello {...{ key: id, id, caption }} />
1620
```
1721

@@ -21,9 +25,13 @@ Examples of **correct** code for this rule:
2125

2226
```jsx
2327
[<Hello key="first" />, <Hello key="second" />, <Hello key="third" />];
28+
```
2429

30+
```jsx
2531
data.map((x) => <Hello key={x.id}>{x}</Hello>);
32+
```
2633

34+
```jsx
2735
<Hello key={id} {...{ id, caption }} />
2836
```
2937

@@ -43,7 +51,9 @@ Examples of **incorrect** code for this rule:
4351

4452
```jsx
4553
[<></>, <></>, <></>];
54+
```
4655

56+
```jsx
4757
data.map(x => <>{x}</>);
4858
```
4959

0 commit comments

Comments
 (0)