質問編集履歴

1

内容修正

2020/10/29 08:12

投稿

yochun02
yochun02

スコア76

test CHANGED
File without changes
test CHANGED
@@ -22,29 +22,23 @@
22
22
 
23
23
  return(
24
24
 
25
- <>
25
+ <button
26
26
 
27
- {items}
27
+ onClick={() => {
28
28
 
29
- <button
29
+ setItems(items.concat({id: 1, value: "hoge"})) // (1)
30
30
 
31
- onClick={() => {
31
+ /* setItems(items?.concat({id: 1, value: "hoge"})) (2)*/
32
32
 
33
- setItems(items.concat({id: 1, value: "hoge"})) // (1)
33
+ console.log(items)
34
34
 
35
- /* setItems(items?.concat({id: 1, value: "hoge"})) (2)*/
35
+ }
36
36
 
37
- console.log(items)
37
+ }>
38
38
 
39
- }
39
+ Add
40
40
 
41
- }>
42
-
43
- Add
44
-
45
- </button>
41
+ </button>
46
-
47
- </>
48
42
 
49
43
  )
50
44