質問編集履歴

1

記述の修正

2022/01/08 08:02

投稿

bdapt
bdapt

スコア0

test CHANGED
File without changes
test CHANGED
@@ -70,7 +70,7 @@
70
70
 
71
71
  const length = state.length;
72
72
 
73
- const id = length === 0 ? 1 : state[length - 1];
73
+ const id = length === 0 ? 1 : state[length - 1].id + 1;
74
74
 
75
75
  return [...state, { id, ...event }];
76
76