Skip to content

Commit fddd6d3

Browse files
marcodejonghclaude
andauthored
fix: Update BoardRenderer memo to compare litUpHoldsMap by reference (#381)
The previous comparison only checked if litUpHoldsMap was truthy, not whether it had changed. This caused the queue bar preview to not update when navigating to the next climb, since both the old and new climb had a litUpHoldsMap present. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5aed644 commit fddd6d3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/web/app/components/board-renderer/board-renderer.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ const BoardRenderer = React.memo(
4949
if (prevProps.mirrored !== nextProps.mirrored) return false;
5050
if (prevProps.onHoldClick !== nextProps.onHoldClick) return false;
5151

52-
// Compare litUpHoldsMap presence (content comparison is handled by BoardLitupHolds memo)
53-
const prevHasMap = !!prevProps.litUpHoldsMap;
54-
const nextHasMap = !!nextProps.litUpHoldsMap;
55-
if (prevHasMap !== nextHasMap) return false;
52+
// Compare litUpHoldsMap by reference - different climbs have different map objects
53+
if (prevProps.litUpHoldsMap !== nextProps.litUpHoldsMap) return false;
5654

5755
// Compare boardDetails by key identifiers and dimensions
5856
if (prevProps.boardDetails !== nextProps.boardDetails) {

0 commit comments

Comments
 (0)