Optimize ModPackViewPage performance

Avoid re-rendering everything by using useCallback and memo to skip
rendering of form elements that haven't changed.
This commit is contained in:
Hornwitser committed 2023-06-11 17:30:29 +02:00
1 parent 790b03bc03
commit 7a9aec74b5
2 files changed
+130 -90

No files matched your search

+13
View File
@@ -112,6 +112,19 @@ class ModPack {
*/
isDeleted = false;
shallowClone() {
const clone = new this.constructor();
clone.id = this.id;
clone.name = this.name;
clone.description = this.description;
clone.factorioVersion = this.factorioVersion;
clone.mods = this.mods;
clone.settings = this.settings;
clone.exportManifest = this.exportManifest;
clone.isDeleted = this.isDeleted;
return clone;
}
static jsonSchema = {
type: "object",
additionalProperties: false,