質問編集履歴
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,10 +16,9 @@
|
|
16
16
|
19 |
|
17
17
|
20 | // SWRを使ってデータを取得する
|
18
18
|
21 | const { data: todo, error } = useSWR<TodoType>(id ? `http://localhost:3000/todos/${id}` : null,
|
19
|
+
どうしたらいいかわからない。
|
19
20
|
|
20
|
-
|
21
21
|
### エラーメッセージ
|
22
|
-
```error
|
23
22
|
Unhandled Runtime Error
|
24
23
|
TypeError: Cannot destructure property 'id' of 'router.query' as it is undefined.
|
25
24
|
|
@@ -34,7 +33,6 @@
|
|
34
33
|
20 | // SWRを使ってデータを取得する
|
35
34
|
21 | const { data: todo, error } = useSWR<TodoType>(id ? `http://localhost:3000/todos/${id}` : null,
|
36
35
|
|
37
|
-
```
|
38
36
|
|
39
37
|
### 該当のソースコード
|
40
38
|
|