Skip to content

Commit 05583d1

Browse files
committed
cache centers with useMemo
1 parent 7afa8d7 commit 05583d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

static/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const { useState, useEffect } = React;
22

3-
// Simple SVG icon components
43
const ServerIcon = (props) => React.createElement('svg', {
54
xmlns: 'http://www.w3.org/2000/svg',
65
fill: 'none',
@@ -578,6 +577,7 @@ const NetworkMonitor = () => {
578577
}
579578
}, [draggedDevice, draggedBox, resizingBox, offset, zoom, panOffset]);
580579

580+
// stackoverflow says this should make things more efficient... we shall see
581581
const deviceCenters = React.useMemo(() => {
582582
const centers = {};
583583
devices.forEach(device => {

0 commit comments

Comments
 (0)