mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 02:13:41 +00:00
Merge pull request #58 from jhbruhn/feature/react-memo-optimization
feature: Enhance Konva rendering with React.memo optimization
This commit is contained in:
commit
d213ab49e2
1 changed files with 3 additions and 3 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
* Handles both interactive (draggable/rotatable) and locked states
|
* Handles both interactive (draggable/rotatable) and locked states
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useMemo, type RefObject } from "react";
|
import { useMemo, memo, type RefObject } from "react";
|
||||||
import { Group, Transformer } from "react-konva";
|
import { Group, Transformer } from "react-konva";
|
||||||
import type Konva from "konva";
|
import type Konva from "konva";
|
||||||
import type { KonvaEventObject } from "konva/lib/Node";
|
import type { KonvaEventObject } from "konva/lib/Node";
|
||||||
|
|
@ -30,7 +30,7 @@ interface PatternLayerProps {
|
||||||
attachTransformer?: () => void;
|
attachTransformer?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PatternLayer({
|
export const PatternLayer = memo(function PatternLayer({
|
||||||
pesData,
|
pesData,
|
||||||
offset,
|
offset,
|
||||||
rotation = 0,
|
rotation = 0,
|
||||||
|
|
@ -143,4 +143,4 @@ export function PatternLayer({
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue