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 ec22e9e commit d1b03ebCopy full SHA for d1b03eb
src/App.js
@@ -61,7 +61,15 @@ const AddButton = ({ disabled, onClick }) => {
61
const Total = ({ cartItems }) => {
62
console.log('renders <Total />');
63
64
- const total = cartItems.reduce((acc, cur) => cur.length * 100 + acc, 0);
+ const total = cartItems.reduce((acc, cur) => {
65
+ const t = Date.now();
66
+
67
+ while (Date.now() - t < 100) {
68
+ // 擬似的に100ミリ秒の遅延を発生させる
69
+ }
70
71
+ return cur.length * 100 + acc;
72
+ }, 0);
73
74
return <p>合計: {total}円</p>;
75
};
0 commit comments