Skip to content

Commit

Permalink
refactor: remove useless memo hook
Browse files Browse the repository at this point in the history
  • Loading branch information
wadjih-bencheikh18 committed Aug 22, 2023
1 parent 33197ed commit 69e94e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
6 changes: 2 additions & 4 deletions src/components/roi/annotation/ConvexHullAnnotation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ function ConvexHullAnnotation({ roi }: ConvexHullAnnotationProps) {
);

const preferences = usePreferences();
const { color, enabled, fontColor, fontSize } = useMemo(
() => preferences.rois.annotations.convexHull,
[preferences.rois.annotations.convexHull],
);
const { color, enabled, fontColor, fontSize } =
preferences.rois.annotations.convexHull;

const polygonStyle: CSSProperties = useMemo(
() => ({
Expand Down
6 changes: 2 additions & 4 deletions src/components/roi/annotation/FeretAnnotation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ function FeretAnnotation({ roi }: FeretAnnotationProps) {
);

const preferences = usePreferences();
const { color, enabled, fontColor, fontSize } = useMemo(
() => preferences.rois.annotations.feretDiameters,
[preferences.rois.annotations.feretDiameters],
);
const { color, enabled, fontColor, fontSize } =
preferences.rois.annotations.feretDiameters;

const lineStyle: CSSProperties = useMemo(
() => ({
Expand Down
6 changes: 2 additions & 4 deletions src/components/roi/annotation/MBRAnnotation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ function MBRAnnotation({ roi }: MBRAnnotationProps) {
[roi.mbr.points],
);
const preferences = usePreferences();
const { color, enabled, fontSize, fontColor } = useMemo(
() => preferences.rois.annotations.minimalBoundingRectangle,
[preferences.rois.annotations.minimalBoundingRectangle],
);
const { color, enabled, fontSize, fontColor } =
preferences.rois.annotations.minimalBoundingRectangle;

const polygonStyle: CSSProperties = useMemo(
() => ({
Expand Down
5 changes: 1 addition & 4 deletions src/components/roi/annotation/SurfaceAnnotation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ interface SurfaceAnnotationProps {
function SurfaceAnnotation({ roi }: SurfaceAnnotationProps) {
const preferences = usePreferences();

const { color, enabled } = useMemo(
() => preferences.rois.annotations.surface,
[preferences.rois.annotations.surface],
);
const { color, enabled } = preferences.rois.annotations.surface;

const rectStyle: CSSProperties = useMemo(
() => ({
Expand Down

0 comments on commit 69e94e3

Please sign in to comment.