From 9ad1b5184f34452a1b8455809cecb47104feab64 Mon Sep 17 00:00:00 2001 From: L1ght-time Date: Mon, 27 May 2024 02:16:00 +0300 Subject: [PATCH] feat: added memoization for fileName function --- src/components/AddressInfo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/AddressInfo.js b/src/components/AddressInfo.js index 2900fa3..135adfe 100644 --- a/src/components/AddressInfo.js +++ b/src/components/AddressInfo.js @@ -1,6 +1,6 @@ import * as jsonexport from "jsonexport/dist"; import moment from "moment"; -import {useCallback, useContext, useEffect, useRef, useState} from 'react'; +import {useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react'; import { Button, Col, Container, Dropdown, Form, Row, Spinner } from "react-bootstrap"; import { CSVLink } from "react-csv"; import { BiGhost } from "react-icons/bi"; @@ -293,7 +293,7 @@ const AddressInfo = () => { } }, [view, txs, utxos]); - const fileName = getFileName(view, limit, addr, utxos.length); + const fileName = useMemo(() => getFileName(view, limit, addr, utxos.length), [view, limit, addr, utxos]); return