mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
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:
1 parent
790b03bc03
commit
7a9aec74b5
2 files changed
+130
-90
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user