Skip to content

Commit 121a176

Browse files
committed
Add test case with React built-in key
1 parent eaca849 commit 121a176

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

snapshots/input/react/src/LoaderInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export const LoaderInput: React.FunctionComponent<Props> = ({
1717
)
1818

1919
export const LoaderInput2: React.FunctionComponent<Props> = props => {
20-
return <LoaderInput loading={true} children={props.children} />
20+
return <LoaderInput loading={true} key="key" children={props.children} />
2121
}

snapshots/output/react/src/LoaderInput.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@
4141
// ^^^^^^^^^^^^^^^^^ reference @types/react 17.0.0 `index.d.ts`/React/FunctionComponent#
4242
// ^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#
4343
// ^^^^^ definition local 7
44-
return <LoaderInput loading={true} children={props.children} />
44+
return <LoaderInput loading={true} key="key" children={props.children} />
4545
// ^^^^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/LoaderInput.
4646
// ^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#loading.
47-
// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children.
48-
// ^^^^^ reference local 7
49-
// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children.
50-
// ^^^^^^^^ reference local 11
47+
// ^^^ reference local 11
48+
// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children.
49+
// ^^^^^ reference local 7
50+
// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children.
51+
// ^^^^^^^^ reference local 15
5152
}
5253

0 commit comments

Comments
 (0)