Skip to content

Commit eeb5ef4

Browse files
committed
Fix never-firing mobx reaction in editable pairs
1 parent 3370abc commit eeb5ef4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/common/editable-pairs.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export class EditablePairs<R> extends React.Component<EditablePairsProps<R>> {
111111
this.values = _.cloneDeep(pairs);
112112
this.lastValuesLength = this.values.length;
113113
}
114-
}
114+
},
115+
{ equals: comparer.structural }
115116
));
116117

117118
disposeOnUnmount(this, autorun(() => {
@@ -140,7 +141,7 @@ export class EditablePairs<R> extends React.Component<EditablePairsProps<R>> {
140141
if (this.props.convertResult) {
141142
return this.props.convertResult(pairs);
142143
} else {
143-
return pairs as unknown as R;
144+
return _.cloneDeep(pairs) as unknown as R;
144145
}
145146
};
146147

0 commit comments

Comments
 (0)