We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f078fe7 commit 6ba6502Copy full SHA for 6ba6502
src/App.js
@@ -66,15 +66,7 @@ const AddButton = ({ disabled, onClick }) => {
66
const Total = ({ cartItems }) => {
67
console.log('renders <Total />');
68
69
- const total = cartItems.reduce((acc, cur) => {
70
- const t = Date.now();
71
-
72
- while (Date.now() - t < 100) {
73
- // 擬似的に100ミリ秒の遅延を発生させる
74
- }
75
76
- return cur.length * 100 + acc;
77
- }, 0);
+ const total = cartItems.reduce((acc, cur) => cur.length * 100 + acc, 0);
78
79
return <p>合計: {total}円</p>;
80
};
0 commit comments