Commit fcdf0f2d authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Merge pull request #643 from blockscout/add-memo

add memo to prevent unnecessary re-render
parents e491c96f cbae8562
...@@ -26,7 +26,7 @@ type Props = { ...@@ -26,7 +26,7 @@ type Props = {
tx: Transaction; tx: Transaction;
} }
const LatestBlocksItem = ({ tx }: Props) => { const LatestTxsItem = ({ tx }: Props) => {
const dataTo = tx.to ? tx.to : tx.created_contract; const dataTo = tx.to ? tx.to : tx.created_contract;
const timeAgo = useTimeAgoIncrement(tx.timestamp || '0', true); const timeAgo = useTimeAgoIncrement(tx.timestamp || '0', true);
...@@ -126,4 +126,4 @@ const LatestBlocksItem = ({ tx }: Props) => { ...@@ -126,4 +126,4 @@ const LatestBlocksItem = ({ tx }: Props) => {
); );
}; };
export default LatestBlocksItem; export default React.memo(LatestTxsItem);
...@@ -28,4 +28,4 @@ const TokenTransferList = ({ data, baseAddress, showTxInfo, enableTimeIncrement ...@@ -28,4 +28,4 @@ const TokenTransferList = ({ data, baseAddress, showTxInfo, enableTimeIncrement
); );
}; };
export default TokenTransferList; export default React.memo(TokenTransferList);
...@@ -24,4 +24,4 @@ const TokenTransferList = ({ data, tokenId }: Props) => { ...@@ -24,4 +24,4 @@ const TokenTransferList = ({ data, tokenId }: Props) => {
); );
}; };
export default TokenTransferList; export default React.memo(TokenTransferList);
...@@ -136,4 +136,4 @@ const TxsListItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement }: ...@@ -136,4 +136,4 @@ const TxsListItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement }:
); );
}; };
export default TxsListItem; export default React.memo(TxsListItem);
...@@ -87,4 +87,4 @@ const TxsTable = ({ ...@@ -87,4 +87,4 @@ const TxsTable = ({
); );
}; };
export default TxsTable; export default React.memo(TxsTable);
...@@ -145,4 +145,4 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement } ...@@ -145,4 +145,4 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement }
); );
}; };
export default TxsTableItem; export default React.memo(TxsTableItem);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment