1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 17:12:30 +01:00

Do not re-render rows excessively

This commit is contained in:
Dane Everitt 2020-09-27 09:30:05 -07:00
parent 3e899ffc51
commit da0b527715
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -92,4 +92,11 @@ const FileObjectRow = ({ file }: { file: FileObject }) => (
</Row>
);
export default memo(FileObjectRow, isEqual);
export default memo(FileObjectRow, (prevProps, nextProps) => {
/* eslint-disable @typescript-eslint/no-unused-vars */
const { isArchiveType, isEditable, ...prevFile } = prevProps.file;
const { isArchiveType: nextIsArchiveType, isEditable: nextIsEditable, ...nextFile } = nextProps.file;
/* eslint-enable @typescript-eslint/no-unused-vars */
return isEqual(prevFile, nextFile);
});