mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 02:13:41 +00:00
fix: Remove ineffective React.memo from PatternCanvas
Address Copilot review feedback: PatternCanvas doesn't accept any props, so React.memo has no effect. The component re-renders are driven by Zustand store subscriptions which trigger regardless of memoization. Keep React.memo on PatternLayer since it does receive props and benefits from memoization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
512eb732de
commit
77ec00df86
1 changed files with 3 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { useRef, useMemo, memo } from "react";
|
import { useRef, useMemo } from "react";
|
||||||
import { useShallow } from "zustand/react/shallow";
|
import { useShallow } from "zustand/react/shallow";
|
||||||
import {
|
import {
|
||||||
useMachineStore,
|
useMachineStore,
|
||||||
|
|
@ -23,7 +23,7 @@ import { ZoomControls } from "./ZoomControls";
|
||||||
import { PatternLayer } from "./PatternLayer";
|
import { PatternLayer } from "./PatternLayer";
|
||||||
import { useCanvasViewport, usePatternTransform } from "@/hooks";
|
import { useCanvasViewport, usePatternTransform } from "@/hooks";
|
||||||
|
|
||||||
export const PatternCanvas = memo(function PatternCanvas() {
|
export function PatternCanvas() {
|
||||||
// Machine store
|
// Machine store
|
||||||
const { sewingProgress, machineInfo } = useMachineStore(
|
const { sewingProgress, machineInfo } = useMachineStore(
|
||||||
useShallow((state) => ({
|
useShallow((state) => ({
|
||||||
|
|
@ -277,4 +277,4 @@ export const PatternCanvas = memo(function PatternCanvas() {
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue