Memoize recommended contracts widget

This commit is contained in:
Marshall Polaris 2022-09-20 21:51:53 -07:00
parent 732656049b
commit 024f03af6d

View File

@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState } from 'react' import React, { memo, useEffect, useMemo, useState } from 'react'
import { ArrowLeftIcon } from '@heroicons/react/outline' import { ArrowLeftIcon } from '@heroicons/react/outline'
import { useContractWithPreload } from 'web/hooks/use-contract' import { useContractWithPreload } from 'web/hooks/use-contract'
@ -269,6 +269,7 @@ export function ContractPageContent(
) )
} }
const RecommendedContractsWidget = memo(
function RecommendedContractsWidget(props: { contract: Contract }) { function RecommendedContractsWidget(props: { contract: Contract }) {
const { contract } = props const { contract } = props
const user = useUser() const user = useUser()
@ -292,3 +293,4 @@ function RecommendedContractsWidget(props: { contract: Contract }) {
</Col> </Col>
) )
} }
)