Skip to content

Commit bfe3945

Browse files
committed
Avoid spread in accumulators
1 parent 36645a1 commit bfe3945

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/react-date-picker/src/DateInput.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function renderCustomInputs(
146146
// eslint-disable-next-line react/no-array-index-key
147147
<Divider key={`separator_${index}`}>{element}</Divider>
148148
);
149-
const res = [...arr, divider];
149+
arr.push(divider);
150150
const currentMatch = matches && matches[index];
151151

152152
if (currentMatch) {
@@ -159,18 +159,18 @@ function renderCustomInputs(
159159
];
160160

161161
if (!renderFunction) {
162-
return res;
162+
return arr;
163163
}
164164

165165
if (!allowMultipleInstances && usedFunctions.includes(renderFunction)) {
166-
res.push(currentMatch);
166+
arr.push(currentMatch);
167167
} else {
168-
res.push(renderFunction(currentMatch, index));
168+
arr.push(renderFunction(currentMatch, index));
169169
usedFunctions.push(renderFunction);
170170
}
171171
}
172172

173-
return res;
173+
return arr;
174174
}, []);
175175
}
176176

0 commit comments

Comments
 (0)