Skip to content

Commit 85dc42c

Browse files
committed
Refine Animated Componenet code
1 parent 944d05c commit 85dc42c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/AnimatedCoding.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/* eslint-disable react/display-name */
21
import React from "react";
32
import { motion } from "framer-motion";
43
import svgList from "../constants/icons";
54

6-
// Memoized icon component to prevent unnecessary re-renders
75
const Icon = React.memo(({ svg, index }) => (
86
<motion.div
97
className="relative w-8 h-8 sm:w-12 sm:h-12"
@@ -30,6 +28,8 @@ const Icon = React.memo(({ svg, index }) => (
3028
</motion.div>
3129
));
3230

31+
Icon.displayName = "Icon";
32+
3333
const AnimatedCoding = () => {
3434
const SVGS_PER_ROW = 5;
3535
const ROW_HEIGHT = 64;
@@ -54,7 +54,7 @@ const AnimatedCoding = () => {
5454
>
5555
{doubledSvgList.map((svg, index) => (
5656
<div
57-
key={`${index}-${svg}`} // Unique key combining index and SVG path
57+
key={`${index}-${svg}`}
5858
className="w-full h-full flex justify-center items-center"
5959
>
6060
<Icon svg={svg} index={index} />

0 commit comments

Comments
 (0)