Skip to content

Commit da12119

Browse files
committed
Avoid spread in accumulators
1 parent bc9972f commit da12119

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/react-datetime-picker/src/DateTimeInput.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function renderCustomInputs(
132132
// eslint-disable-next-line react/no-array-index-key
133133
<Divider key={`separator_${index}`}>{element}</Divider>
134134
);
135-
const res = [...arr, divider];
135+
arr.push(divider);
136136
const currentMatch = matches && matches[index];
137137

138138
if (currentMatch) {
@@ -145,18 +145,18 @@ function renderCustomInputs(
145145
];
146146

147147
if (!renderFunction) {
148-
return res;
148+
return arr;
149149
}
150150

151151
if (!allowMultipleInstances && usedFunctions.includes(renderFunction)) {
152-
res.push(currentMatch);
152+
arr.push(currentMatch);
153153
} else {
154-
res.push(renderFunction(currentMatch, index));
154+
arr.push(renderFunction(currentMatch, index));
155155
usedFunctions.push(renderFunction);
156156
}
157157
}
158158

159-
return res;
159+
return arr;
160160
}, []);
161161
}
162162

0 commit comments

Comments
 (0)