Yashotantra Academy
AI · Blockchain · Cloud · Data
Dark mode active
Learn
Tracks
ABCD
Certification
More
▾
Dark mode active
Learn
Tracks
ABCD
Certification
Study
Theory
Code Lab
Build
Solidity IDE
Staking Sandbox
Simulation
Reference
Wallets
Gas Fees
Explorers
← Code Lab
React Native
0/50 solved · 0%
All lessons
lesson
code
Performance · medium
22. Memoization-friendly totals
Write a pure function suitable for useMemo.
Write `computeTotal(txs)` summing `amount` fields, structured so it can be dropped straight into `useMemo(() => computeTotal(txs), [txs])`.
Required in your answer:
.reduce(
Reveal solution
Run & check
Reset
Transpiled, then run in a sandbox
function computeTotal(txs) { // TODO }
Output appears here.
← 21. useReducer for a send form
23. Stable callback identity check →