mirror of
https://github.com/langgenius/dify.git
synced 2025-12-25 01:00:42 -05:00
perf: optimize marketplace card re-renders with memoization (#29263)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user