Reduce redraws
This commit is contained in:
parent
596ed93e0e
commit
3b60030817
|
@ -84,20 +84,42 @@ const TraceItem: React.FC<TraceItemProps> = ({
|
|||
expanded ? "" : "hidden"
|
||||
}`}
|
||||
>
|
||||
{t.children.map((tc, i, a) => (
|
||||
<TraceItem
|
||||
key={i}
|
||||
t={tc}
|
||||
txData={txData}
|
||||
last={i === a.length - 1}
|
||||
fourBytesMap={fourBytesMap}
|
||||
resolvedAddresses={resolvedAddresses}
|
||||
/>
|
||||
))}
|
||||
<TraceChildren
|
||||
c={t.children}
|
||||
txData={txData}
|
||||
fourBytesMap={fourBytesMap}
|
||||
resolvedAddresses={resolvedAddresses}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
type TraceChildrenProps = {
|
||||
c: TraceGroup[];
|
||||
txData: TransactionData;
|
||||
fourBytesMap: Record<string, FourBytesEntry | null | undefined>;
|
||||
resolvedAddresses: ResolvedAddresses | undefined;
|
||||
};
|
||||
|
||||
const TraceChildren: React.FC<TraceChildrenProps> = React.memo(
|
||||
({ c, txData, fourBytesMap, resolvedAddresses }) => {
|
||||
return (
|
||||
<>
|
||||
{c.map((tc, i, a) => (
|
||||
<TraceItem
|
||||
key={i}
|
||||
t={tc}
|
||||
txData={txData}
|
||||
last={i === a.length - 1}
|
||||
fourBytesMap={fourBytesMap}
|
||||
resolvedAddresses={resolvedAddresses}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
export default TraceItem;
|
||||
|
|
Loading…
Reference in New Issue