perf: add React.memo to hot-path components
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useMemo } from 'react'
|
||||
import React from 'react'
|
||||
import Box from '@mui/material/Box'
|
||||
import type { SxProps, Theme } from '@mui/material/styles'
|
||||
|
||||
@@ -35,7 +36,7 @@ function buildFallbackSrc(src: string, width: number): string {
|
||||
return `/uploads-resized/${pathPrefix}${parsed.uuid}.webp?w=${width}`
|
||||
}
|
||||
|
||||
export function OptimizedImage({
|
||||
export const OptimizedImage = React.memo(function OptimizedImage({
|
||||
src,
|
||||
alt,
|
||||
widths = DEFAULT_WIDTHS,
|
||||
|
||||
Reference in New Issue
Block a user