質問編集履歴

1

書き方の修正

2022/05/07 06:39

投稿

takoyan
takoyan

スコア105

test CHANGED
File without changes
test CHANGED
@@ -7,6 +7,7 @@
7
7
  https://zenn.dev/shimapon3/articles/13e3d4b147742c
8
8
  APIの練習として、Rechart.jsを使ったサイトを作りたいと考えています。
9
9
  その練習としてmapで都道府県名を表示させたいと考えているのですが、下記のエラーが出ました。
10
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-05-07/657296a4-ab85-4f00-af8d-9fc1c83e3bd6.png)
10
11
  ```
11
12
  Uncaught TypeError: prefectures.map is not a function
12
13
  at Main (Main.jsx:23:1)
@@ -47,9 +48,9 @@
47
48
  return (
48
49
  <div>
49
50
  <h2>都道府県</h2>
51
+ {
50
- {prefectures.map((prefecture) => (
52
+ prefectures.map((prefecture) => <li>{ prefecture }</li>)
51
- { prefecture.prefName }
52
- ))}
53
+ }
53
54
  <h2>人口推移グラフ</h2>
54
55
  </div>
55
56
  );