chore: memoize modCard
This commit is contained in:
parent
5b641ff4cc
commit
06f0282cad
@ -1,3 +1,4 @@
|
|||||||
|
import React from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import '../styles/cardMod.css'
|
import '../styles/cardMod.css'
|
||||||
import { handleModImageError } from '../utils'
|
import { handleModImageError } from '../utils'
|
||||||
@ -10,13 +11,8 @@ type ModCardProps = {
|
|||||||
route: string
|
route: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ModCard = ({
|
export const ModCard = React.memo(
|
||||||
title,
|
({ title, gameName, summary, imageUrl, route }: ModCardProps) => {
|
||||||
gameName,
|
|
||||||
summary,
|
|
||||||
imageUrl,
|
|
||||||
route
|
|
||||||
}: ModCardProps) => {
|
|
||||||
return (
|
return (
|
||||||
<Link className='cardModMainWrapperLink' to={route}>
|
<Link className='cardModMainWrapperLink' to={route}>
|
||||||
<div className='cardModMain'>
|
<div className='cardModMain'>
|
||||||
@ -90,3 +86,4 @@ export const ModCard = ({
|
|||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user