Skip to content

Commit

Permalink
feat: added memoization for fileName function
Browse files Browse the repository at this point in the history
  • Loading branch information
L1ght-time committed May 26, 2024
1 parent 1658663 commit 9ad1b51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/AddressInfo.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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 <div className="addressinfo-page">
<Container className="webpage addressinfo-box" fluid>
Expand Down

0 comments on commit 9ad1b51

Please sign in to comment.