perf: optimize marketplace card re-renders with memoization (#29263)

This commit is contained in:
yyh
2025-12-08 14:09:03 +08:00
committed by GitHub
parent 6942666d03
commit 2f96374837
4 changed files with 41 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
import React from 'react'
import { RiInstallLine } from '@remixicon/react'
import { formatNumber } from '@/utils/format'
@@ -5,7 +6,7 @@ type Props = {
downloadCount: number
}
const DownloadCount = ({
const DownloadCountComponent = ({
downloadCount,
}: Props) => {
return (
@@ -16,4 +17,7 @@ const DownloadCount = ({
)
}
// Memoize to prevent unnecessary re-renders
const DownloadCount = React.memo(DownloadCountComponent)
export default DownloadCount