質問編集履歴

4

タグついか

2022/12/07 02:43

投稿

kuralie
kuralie

スコア8

test CHANGED
File without changes
test CHANGED
File without changes

3

ファイルの追加

2022/12/07 02:14

投稿

kuralie
kuralie

スコア8

test CHANGED
File without changes
test CHANGED
@@ -62,3 +62,35 @@
62
62
 
63
63
  ぜひご教授お願い致します。
64
64
 
65
+
66
+ 追記
67
+ ```index.tsx
68
+ import { ShopCard } from '../components'
69
+ import { mockData } from 'mockData/ShopData'
70
+
71
+ const Home: NextPage = () => {
72
+ return (
73
+ <div>
74
+ <div className="gap-4 mx-auto px-6 py-3 w-fit max-w-[1200px] grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
75
+ {mockData.map((item, index) => (
76
+ <div key={index} className="border rounded-2xl border-gray-200 bg-white overflow-hidden max-w-[400px]">
77
+ <Link href="/">
78
+ <ShopCard
79
+ name={item.name}
80
+ description={item.description}
81
+ price={item.price}
82
+ image={item.image}
83
+ holidays={item.holidays}
84
+ comments={item.comments}
85
+ />
86
+ </Link>
87
+ </div>
88
+ ))}
89
+ </div>
90
+ </div>
91
+ )
92
+ }
93
+
94
+ export default Home
95
+ ```
96
+

2

誤字の変更

2022/12/07 01:55

投稿

kuralie
kuralie

スコア8

test CHANGED
File without changes
test CHANGED
@@ -7,14 +7,14 @@
7
7
  ### 行ったこと
8
8
  型定義前
9
9
  ```ShopCard.tsx
10
- import Shops from '../types/shops'
10
+ import Shop from '../types/shops'
11
11
 
12
12
  export const ShopCard = (props: Shop) => {
13
13
  const { name, description, price, image, holidays, comments } = props
14
14
  ```
15
15
  変更後
16
16
  ```ShopCard.tsx
17
- import Shops from '../types/shops'
17
+ import Shop from '../types/shops'
18
18
 
19
19
  type Props = {
20
20
  shop: Shop

1

誤字の変更

2022/12/07 01:54

投稿

kuralie
kuralie

スコア8

test CHANGED
File without changes
test CHANGED
@@ -1,9 +1,11 @@
1
1
  ### 前提
2
2
 
3
3
  TypeScriptで型定義を行いました。
4
+
4
5
  その際に起こったエラーが解決できないのでご協力をお願いしたいです
5
6
 
6
7
  ### 行ったこと
8
+ 型定義前
7
9
  ```ShopCard.tsx
8
10
  import Shops from '../types/shops'
9
11
 
@@ -21,6 +23,8 @@
21
23
  const ShopCard: React.FC<Props> = ({ shop }) => {
22
24
  const { name, description, price, image, holidays, comments } = shop
23
25
  ```
26
+
27
+ 変更前にエラーはありませんでした
24
28
 
25
29
  ### 発生している問題・エラーメッセージ
26
30