Skip to content

Commit

Permalink
Fix issue StrictMode issue where dependencies are incorrectly updated
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbooth committed Jan 2, 2025
1 parent 37821b4 commit f71889a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/gl-react/src/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,10 @@ export default class Node extends Component<Props, *> {
newdeps: Array<Node | Bus>
): [Array<Bus | Node>, Array<Bus | Node>] {
const olddeps = this.dependencies;
const additions = newdeps.filter((node) => olddeps.indexOf(node) === -1);
const deletions = olddeps.filter((node) => newdeps.indexOf(node) === -1);
additions.forEach((d) => d._addDependent(this));
deletions.forEach((d) => d._removeDependent(this));
const additions = newdeps.filter(node => olddeps.indexOf(node) === -1);
const deletions = olddeps.filter(node => newdeps.indexOf(node) === -1);
olddeps.forEach(d => d._removeDependent(this));
newdeps.forEach(d => d._addDependent(this));
this.dependencies = newdeps;
return [additions, deletions];
}
Expand Down

0 comments on commit f71889a

Please sign in to comment.