@@ -28,7 +28,13 @@ const assertCustomType = (value: ItemData) => {};
28
28
assertString(data);
29
29
return null;
30
30
};
31
- <FixedSizeList width={0} height={0} itemSize={0} itemCount={0} itemData={1}>
31
+ const itemKey = (index, data) => {
32
+ assertNumber(data);
33
+ // $FlowFixMe expected
34
+ assertString(data);
35
+ return index;
36
+ };
37
+ <FixedSizeList width={0} height={0} itemSize={0} itemCount={0} itemData={1} itemKey={itemKey}>
32
38
{Item}
33
39
</FixedSizeList>;
34
40
}
@@ -40,6 +46,12 @@ const assertCustomType = (value: ItemData) => {};
40
46
assertString(data);
41
47
return null;
42
48
};
49
+ const itemKey = (index, data) => {
50
+ assertCustomType(data);
51
+ // $FlowFixMe expected
52
+ assertString(data);
53
+ return index;
54
+ };
43
55
<FixedSizeList
44
56
width={0}
45
57
height={0}
@@ -49,6 +61,7 @@ const assertCustomType = (value: ItemData) => {};
49
61
num: 123,
50
62
str: 'abc',
51
63
}}
64
+ itemKey={itemKey}
52
65
>
53
66
{Item}
54
67
</FixedSizeList>;
@@ -61,7 +74,13 @@ const assertCustomType = (value: ItemData) => {};
61
74
assertEmpty(data);
62
75
return null;
63
76
};
64
- <FixedSizeList width={0} height={0} itemSize={0} itemCount={0}>
77
+ const itemKey = (index, data) => {
78
+ assertVoid(data);
79
+ // $FlowFixMe expected
80
+ assertString(data);
81
+ return index;
82
+ };
83
+ <FixedSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
65
84
{Item}
66
85
</FixedSizeList>;
67
86
}
@@ -75,12 +94,19 @@ const assertCustomType = (value: ItemData) => {};
75
94
assertString(data);
76
95
return null;
77
96
};
97
+ const itemKey = (index, data) => {
98
+ assertNumber(data);
99
+ // $FlowFixMe expected
100
+ assertString(data);
101
+ return index;
102
+ };
78
103
<VariableSizeList
79
104
width={0}
80
105
height={0}
81
106
itemSize={0}
82
107
itemCount={0}
83
108
itemData={1}
109
+ itemKey={itemKey}
84
110
>
85
111
{Item}
86
112
</VariableSizeList>;
@@ -93,6 +119,12 @@ const assertCustomType = (value: ItemData) => {};
93
119
assertString(data);
94
120
return null;
95
121
};
122
+ const itemKey = (index, data) => {
123
+ assertCustomType(data);
124
+ // $FlowFixMe expected
125
+ assertString(data);
126
+ return index;
127
+ };
96
128
<VariableSizeList
97
129
width={0}
98
130
height={0}
@@ -102,6 +134,7 @@ const assertCustomType = (value: ItemData) => {};
102
134
num: 123,
103
135
str: 'abc',
104
136
}}
137
+ itemKey={itemKey}
105
138
>
106
139
{Item}
107
140
</VariableSizeList>;
@@ -114,7 +147,13 @@ const assertCustomType = (value: ItemData) => {};
114
147
assertEmpty(data);
115
148
return null;
116
149
};
117
- <VariableSizeList width={0} height={0} itemSize={0} itemCount={0}>
150
+ const itemKey = (index, data) => {
151
+ assertVoid(data);
152
+ // $FlowFixMe expected
153
+ assertString(data);
154
+ return index;
155
+ };
156
+ <VariableSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
118
157
{Item}
119
158
</VariableSizeList>;
120
159
}
@@ -129,7 +168,13 @@ const assertCustomType = (value: ItemData) => {};
129
168
return null;
130
169
}
131
170
}
132
- <VariableSizeList width={0} height={0} itemSize={0} itemCount={0}>
171
+ const itemKey = (index, data) => {
172
+ assertVoid(data);
173
+ // $FlowFixMe expected
174
+ assertString(data);
175
+ return index;
176
+ };
177
+ <VariableSizeList width={0} height={0} itemSize={0} itemCount={0} itemKey={itemKey}>
133
178
{Item}
134
179
</VariableSizeList>;
135
180
}
@@ -143,6 +188,12 @@ const assertCustomType = (value: ItemData) => {};
143
188
assertString(data);
144
189
return null;
145
190
};
191
+ const itemKey = ({ columnIndex, data, rowIndex }) => {
192
+ assertNumber(data);
193
+ // $FlowFixMe expected
194
+ assertString(data);
195
+ return `${columnIndex}:${rowIndex}`;
196
+ };
146
197
<FixedSizeGrid
147
198
width={0}
148
199
height={0}
@@ -151,6 +202,7 @@ const assertCustomType = (value: ItemData) => {};
151
202
columnWidth={0}
152
203
columnCount={0}
153
204
itemData={1}
205
+ itemKey={itemKey}
154
206
>
155
207
{Item}
156
208
</FixedSizeGrid>;
@@ -163,6 +215,12 @@ const assertCustomType = (value: ItemData) => {};
163
215
assertString(data);
164
216
return null;
165
217
};
218
+ const itemKey = ({ columnIndex, data, rowIndex }) => {
219
+ assertCustomType(data);
220
+ // $FlowFixMe expected
221
+ assertString(data);
222
+ return `${columnIndex}:${rowIndex}`;
223
+ };
166
224
<FixedSizeGrid
167
225
width={0}
168
226
height={0}
@@ -174,6 +232,7 @@ const assertCustomType = (value: ItemData) => {};
174
232
num: 123,
175
233
str: 'abc',
176
234
}}
235
+ itemKey={itemKey}
177
236
>
178
237
{Item}
179
238
</FixedSizeGrid>;
@@ -186,13 +245,20 @@ const assertCustomType = (value: ItemData) => {};
186
245
assertEmpty(data);
187
246
return null;
188
247
};
248
+ const itemKey = ({ columnIndex, data, rowIndex }) => {
249
+ assertVoid(data);
250
+ // $FlowFixMe expected
251
+ assertString(data);
252
+ return `${columnIndex}:${rowIndex}`;
253
+ };
189
254
<FixedSizeGrid
190
255
width={0}
191
256
height={0}
192
257
rowHeight={0}
193
258
rowCount={0}
194
259
columnWidth={0}
195
260
columnCount={0}
261
+ itemKey={itemKey}
196
262
>
197
263
{Item}
198
264
</FixedSizeGrid>;
0 commit comments