Memoize recommended contracts widget
This commit is contained in:
parent
732656049b
commit
024f03af6d
|
@ -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 { useContractWithPreload } from 'web/hooks/use-contract'
|
||||
|
@ -269,7 +269,8 @@ export function ContractPageContent(
|
|||
)
|
||||
}
|
||||
|
||||
function RecommendedContractsWidget(props: { contract: Contract }) {
|
||||
const RecommendedContractsWidget = memo(
|
||||
function RecommendedContractsWidget(props: { contract: Contract }) {
|
||||
const { contract } = props
|
||||
const user = useUser()
|
||||
const [recommendations, setRecommendations] = useState<Contract[]>([])
|
||||
|
@ -291,4 +292,5 @@ function RecommendedContractsWidget(props: { contract: Contract }) {
|
|||
/>
|
||||
</Col>
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user